From 6af634d4e33308dfab09169f2c70da371a71f6df Mon Sep 17 00:00:00 2001 From: Trent Hensler Date: Fri, 2 Mar 2018 10:55:52 -0800 Subject: [PATCH] Check for null --- .../massivecraft/factions/zcore/persist/MemoryFPlayer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java index cfa74bb7..75ae196c 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java @@ -113,6 +113,11 @@ public abstract class MemoryFPlayer implements FPlayer { } public Role getRole() { + // Hack to fix null roles.. + if (role == null) { + this.role = Role.NORMAL; + } + return this.role; } @@ -776,7 +781,7 @@ public abstract class MemoryFPlayer implements FPlayer { return attemptClaim(forFaction, new FLocation(location), notifyFailure); } - public boolean attemptClaim(Faction forFaction, FLocation flocation, boolean notifyFailure) { + public boolean attemptClaim(Faction forFaction, FLocation flocation, boolean notifyFailure) { // notifyFailure is false if called by auto-claim; no need to notify on every failure for it // return value is false on failure, true on success