corp: Null checks

This commit is contained in:
sdburns1998
2019-07-07 06:29:39 +02:00
parent 1620842c97
commit e9e59daf57

View File

@@ -167,7 +167,7 @@ public class CorpPlugin extends Plugin
{ {
NPC npc = npcDespawned.getNpc(); NPC npc = npcDespawned.getNpc();
if (npc.equals(corp)) if (npc != null && npc.equals(corp))
{ {
log.debug("Corporeal beast despawn: {}", npc); log.debug("Corporeal beast despawn: {}", npc);
corp = null; corp = null;
@@ -193,7 +193,7 @@ public class CorpPlugin extends Plugin
.build()); .build());
} }
} }
else if (npc.equals(core)) else if (npc != null && npc.equals(core))
{ {
core = null; core = null;
} }
@@ -204,7 +204,7 @@ public class CorpPlugin extends Plugin
{ {
Actor actor = hitsplatApplied.getActor(); Actor actor = hitsplatApplied.getActor();
if (!actor.equals(corp)) if (actor != null && !actor.equals(corp))
{ {
return; return;
} }
@@ -224,7 +224,7 @@ public class CorpPlugin extends Plugin
Actor source = interactingChanged.getSource(); Actor source = interactingChanged.getSource();
Actor target = interactingChanged.getTarget(); Actor target = interactingChanged.getTarget();
if (!target.equals(corp)) if (target != null && !target.equals(corp))
{ {
return; return;
} }