From 9384b0faa683605c3bcd27d73e8f0818076e5fda Mon Sep 17 00:00:00 2001 From: Trent Hensler Date: Sat, 3 Feb 2018 12:38:36 -0800 Subject: [PATCH] Check for null --- .../factions/zcore/persist/MemoryFaction.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java index a20518d2..586bdfe3 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java @@ -326,6 +326,10 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { public Access getAccess(Permissable permissable, Action action) { + if (permissable == null || action == null) { + return null; + } + Map accessMap = permissions.get(permissable); if (accessMap != null && accessMap.containsKey(action)) { return accessMap.get(action); @@ -342,6 +346,10 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { * @return */ public Access getAccess(FPlayer player, Action action) { + if (player == null || action == null) { + return null; + } + Permissable perm; if (player.getFaction() == this) { @@ -367,7 +375,6 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { accessMap.put(action, access); } - public void resetPerms() { P.p.log(Level.WARNING, "Resetting permissions for Faction: " + tag);