From 69b7981914881b3bf4608d4108c95c50a3cfed3e Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Wed, 25 Dec 2013 23:01:56 -0600 Subject: [PATCH] Only try to load the previous gamemode if it isn't null. --- src/main/java/com/graywolf336/jail/JailIO.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/graywolf336/jail/JailIO.java b/src/main/java/com/graywolf336/jail/JailIO.java index a58bb71..34d5ca7 100644 --- a/src/main/java/com/graywolf336/jail/JailIO.java +++ b/src/main/java/com/graywolf336/jail/JailIO.java @@ -219,7 +219,8 @@ public class JailIO { flat.set(cNode + "prisoner.offlinePending", p.isOfflinePending()); flat.set(cNode + "prisoner.reason", p.getReason()); flat.set(cNode + "prisoner.previousLocation", p.getPreviousLocationString()); - flat.set(cNode + "prisoner.previousGameMode", p.getPreviousGameMode().toString()); + if(p.getPreviousGameMode() != null) + flat.set(cNode + "prisoner.previousGameMode", p.getPreviousGameMode().toString()); } } @@ -230,7 +231,8 @@ public class JailIO { flat.set(pNode + "offlinePending", p.isOfflinePending()); flat.set(pNode + "reason", p.getReason()); flat.set(pNode + "previousLocation", p.getPreviousLocationString()); - flat.set(pNode + "previousGameMode", p.getPreviousGameMode().toString()); + if(p.getPreviousGameMode() != null) + flat.set(pNode + "previousGameMode", p.getPreviousGameMode().toString()); } try {