Strange NPE evade. Fixes #534, #387, #692

This commit is contained in:
Olof Larsson committed 2014-10-06 13:24:52 +02:00
1 parent 8d285eab34
commit 662dbb85ed
1 file changed
+7 -1
@@ -665,8 +665,14 @@ public class FactionsListenerMain implements Listener
if (reason != SpawnReason.NATURAL && reason != SpawnReason.JOCKEY) return;
// ... and monsters are forbidden at the location ...
PS ps = PS.valueOf(event.getLocation());
Location location = event.getLocation();
if (location == null) return;
PS ps = PS.valueOf(location);
Faction faction = BoardColl.get().getFactionAt(ps);
if (faction == null) return;
if (faction.getFlag(MFlag.getMonsters())) return;
// ... block the spawn.