chatcommands: Fix adventure log widget NPE

This commit is contained in:
BossHuso
2021-02-18 14:54:14 -08:00
committed by Adam
parent bd67d82bbb
commit 0cec0039ca

View File

@@ -481,12 +481,16 @@ public class ChatCommandsPlugin extends Plugin
advLogLoaded = false; advLogLoaded = false;
Widget adventureLog = client.getWidget(WidgetInfo.ADVENTURE_LOG); Widget adventureLog = client.getWidget(WidgetInfo.ADVENTURE_LOG);
if (adventureLog != null)
{
Matcher advLogExploitsText = ADVENTURE_LOG_TITLE_PATTERN.matcher(adventureLog.getChild(ADV_LOG_EXPLOITS_TEXT_INDEX).getText()); Matcher advLogExploitsText = ADVENTURE_LOG_TITLE_PATTERN.matcher(adventureLog.getChild(ADV_LOG_EXPLOITS_TEXT_INDEX).getText());
if (advLogExploitsText.find()) if (advLogExploitsText.find())
{ {
pohOwner = advLogExploitsText.group(1); pohOwner = advLogExploitsText.group(1);
} }
} }
}
if (bossLogLoaded && (pohOwner == null || pohOwner.equals(client.getLocalPlayer().getName()))) if (bossLogLoaded && (pohOwner == null || pohOwner.equals(client.getLocalPlayer().getName())))
{ {