Harden against null
This commit is contained in:
1 parent
ea23003807
commit
e73b8d2826
1 file changed
+4
-2
@@ -343,7 +343,8 @@ public enum BuildingManager {
|
||||
Mob hirelingMob = (Mob) hireling;
|
||||
|
||||
if (hirelingMob.getParentZone() != null)
|
||||
hirelingMob.getParentZone().zoneMobSet.remove(hireling);
|
||||
if (hirelingMob.getParentZone().zoneMobSet.contains(hirelingMob))
|
||||
hirelingMob.getParentZone().zoneMobSet.remove(hireling);
|
||||
|
||||
}
|
||||
|
||||
@@ -352,7 +353,8 @@ public enum BuildingManager {
|
||||
NPC hirelingNPC = (NPC) hireling;
|
||||
|
||||
if (hirelingNPC.getParentZone() != null)
|
||||
hirelingNPC.getParentZone().zoneNPCSet.remove(hireling);
|
||||
if (hirelingNPC.getParentZone().zoneNPCSet.contains(hirelingNPC))
|
||||
hirelingNPC.getParentZone().zoneNPCSet.remove(hireling);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user