From a70ee689c63dbba8a5e7270498c6c7a9443d42c3 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Wed, 26 Nov 2014 15:01:12 +0100 Subject: [PATCH] NPE evade. Fixes #712. --- src/main/java/com/massivecraft/factions/engine/EngineMain.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/factions/engine/EngineMain.java b/src/main/java/com/massivecraft/factions/engine/EngineMain.java index f03afb5d..4e59b2e4 100644 --- a/src/main/java/com/massivecraft/factions/engine/EngineMain.java +++ b/src/main/java/com/massivecraft/factions/engine/EngineMain.java @@ -1019,7 +1019,8 @@ public class EngineMain extends EngineAbstract // ... if there is a faction at the players location ... PS ps = PS.valueOf(player.getLocation()).getChunk(true); Faction factionAtPs = BoardColl.get().getFactionAt(ps); - if (factionAtPs.isNone()) return; // TODO: An NPE can arise here? Why? + if (factionAtPs == null) return; + if (factionAtPs.isNone()) return; // ... the command may be denied in the territory of this relation type ... Rel rel = factionAtPs.getRelationTo(mplayer);