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,10 +481,14 @@ public class ChatCommandsPlugin extends Plugin
advLogLoaded = false;
Widget adventureLog = client.getWidget(WidgetInfo.ADVENTURE_LOG);
Matcher advLogExploitsText = ADVENTURE_LOG_TITLE_PATTERN.matcher(adventureLog.getChild(ADV_LOG_EXPLOITS_TEXT_INDEX).getText());
if (advLogExploitsText.find())
if (adventureLog != null)
{
pohOwner = advLogExploitsText.group(1);
Matcher advLogExploitsText = ADVENTURE_LOG_TITLE_PATTERN.matcher(adventureLog.getChild(ADV_LOG_EXPLOITS_TEXT_INDEX).getText());
if (advLogExploitsText.find())
{
pohOwner = advLogExploitsText.group(1);
}
}
}