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

This commit is contained in:
Olof Larsson 2014-10-06 13:24:52 +02:00
parent 8d285eab34
commit 662dbb85ed

View File

@ -665,8 +665,14 @@ public class FactionsListenerMain implements Listener
if (reason != SpawnReason.NATURAL && reason != SpawnReason.JOCKEY) return; if (reason != SpawnReason.NATURAL && reason != SpawnReason.JOCKEY) return;
// ... and monsters are forbidden at the location ... // ... 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); Faction faction = BoardColl.get().getFactionAt(ps);
if (faction == null) return;
if (faction.getFlag(MFlag.getMonsters())) return; if (faction.getFlag(MFlag.getMonsters())) return;
// ... block the spawn. // ... block the spawn.