From 6635ec97105c9a9bf9b993ebf628c86c500f9a5e Mon Sep 17 00:00:00 2001 From: TheComputerGeek2 Date: Sun, 22 Apr 2018 15:55:42 -0700 Subject: [PATCH] Address issue #1271 --- src/com/massivecraft/factions/engine/EnginePermBuild.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/massivecraft/factions/engine/EnginePermBuild.java b/src/com/massivecraft/factions/engine/EnginePermBuild.java index 1b4c3d09..5707224c 100644 --- a/src/com/massivecraft/factions/engine/EnginePermBuild.java +++ b/src/com/massivecraft/factions/engine/EnginePermBuild.java @@ -354,6 +354,8 @@ public class EnginePermBuild extends Engine PS toPs = PS.valueOf(chunkToX, chunkToZ); TerritoryAccess fromTa = map.get(fromPs); TerritoryAccess toTa = map.get(toPs); + + // Null checks are needed here since automatic board cleaning can be undesired sometimes String fromId = fromTa != null ? fromTa.getHostFactionId() : Factions.ID_NONE; String toId = toTa != null ? toTa.getHostFactionId() : Factions.ID_NONE; @@ -362,7 +364,9 @@ public class EnginePermBuild extends Engine // ... and the faction "from" can not build at "to" ... Faction fromFac = FactionColl.get().getFixed(fromId); + if (fromFac == null) fromFac = FactionColl.get().getNone(); Faction toFac = FactionColl.get().getFixed(toId); + if (toFac == null) toFac = FactionColl.get().getNone(); if (MPerm.getPermBuild().has(fromFac, toFac)) return; // ... cancel the event!