Check Matcher#find (#45)

Fixes #44
This commit is contained in:
sdburns1998
2019-04-22 21:02:33 +02:00
committed by Tyler Bochard
parent 9a4461f7e9
commit b3a43ac9d7

View File

@@ -129,9 +129,9 @@ public class FreezeTimersPlugin extends Plugin
final Pattern ppattern = Pattern.compile("> <col=ffffff>(.+?)<col=");
final Matcher smatch = spattern.matcher(event.getMenuTarget());
final Matcher pmatch = ppattern.matcher(event.getMenuTarget());
smatch.find();
pmatch.find();
if (smatch.group(1) != null && pmatch.group(1) != null)
if (smatch.find() && smatch.group(1) != null &&
pmatch.find() && pmatch.group(1) != null)
{
currticks = ticks;
spell = smatch.group(1);