Fix NPE on Login Screen

This commit is contained in:
Ganom
2019-05-16 17:28:30 -04:00
committed by GitHub
parent b392431766
commit bdcb825e64

View File

@@ -195,6 +195,8 @@ public class ZulrahPlugin extends Plugin
@Subscribe @Subscribe
public void onNpcSpawned(NpcSpawned event) public void onNpcSpawned(NpcSpawned event)
{
try
{ {
NPC npc = event.getNpc(); NPC npc = event.getNpc();
if (npc != null && npc.getName().toLowerCase().contains("zulrah")) if (npc != null && npc.getName().toLowerCase().contains("zulrah"))
@@ -202,9 +204,16 @@ public class ZulrahPlugin extends Plugin
zulrah = npc; zulrah = npc;
} }
} }
catch (Exception e)
{
}
}
@Subscribe @Subscribe
public void onNpcDespawned(NpcDespawned event) public void onNpcDespawned(NpcDespawned event)
{
try
{ {
NPC npc = event.getNpc(); NPC npc = event.getNpc();
if (npc != null && npc.getName().toLowerCase().contains("zulrah")) if (npc != null && npc.getName().toLowerCase().contains("zulrah"))
@@ -212,6 +221,11 @@ public class ZulrahPlugin extends Plugin
zulrah = null; zulrah = null;
} }
} }
catch (Exception e)
{
}
}
public ZulrahInstance getInstance() public ZulrahInstance getInstance()
{ {