stronghold: nullcheck
This commit is contained in:
@@ -42,7 +42,8 @@ import java.awt.Color;
|
|||||||
name = "Stronghold",
|
name = "Stronghold",
|
||||||
description = "Highlights the correct answer to Stronghold of Security questions",
|
description = "Highlights the correct answer to Stronghold of Security questions",
|
||||||
tags = {"stronghold", "security", "overlay", "answer", "highlight"},
|
tags = {"stronghold", "security", "overlay", "answer", "highlight"},
|
||||||
type = PluginType.UTILITY
|
type = PluginType.UTILITY,
|
||||||
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
public class StrongholdPlugin extends Plugin
|
public class StrongholdPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@@ -87,6 +88,12 @@ public class StrongholdPlugin extends Plugin
|
|||||||
private void onNPCDialogue()
|
private void onNPCDialogue()
|
||||||
{
|
{
|
||||||
final Widget debugWidget = client.getWidget(WidgetInfo.DIALOG_NPC_TEXT);
|
final Widget debugWidget = client.getWidget(WidgetInfo.DIALOG_NPC_TEXT);
|
||||||
|
|
||||||
|
if (debugWidget == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final String npcText = debugWidget.getText();
|
final String npcText = debugWidget.getText();
|
||||||
if (StrongholdAnswer.MATCHES.containsKey(npcText))
|
if (StrongholdAnswer.MATCHES.containsKey(npcText))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user