From e8618c6a40fe4c6eb39a360a8fa64b251fa43a93 Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Wed, 23 Dec 2015 07:56:14 -0800 Subject: [PATCH] Improved logging for claim loading issues. Specifically exceptions with NULL messages. --- src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java | 2 +- src/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java b/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java index dfa8748..c6875fa 100644 --- a/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java +++ b/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java @@ -256,7 +256,7 @@ public class DatabaseDataStore extends DataStore } catch(Exception e) { - if(e.getMessage().contains("World not found")) + if(e.getMessage() != null && e.getMessage().contains("World not found")) { GriefPrevention.AddLogEntry("Failed to load a claim (ID:" + claimID.toString() + ") because its world isn't loaded (yet?). Please delete the claim or contact the GriefPrevention developer with information about which plugin(s) you're using to load or create worlds. " + lesserCornerString); continue; diff --git a/src/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java b/src/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java index 67348a0..df7aecd 100644 --- a/src/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java +++ b/src/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java @@ -359,7 +359,7 @@ public class FlatFileDataStore extends DataStore //if there's any problem with the file's content, log an error message and skip it catch(Exception e) { - if(e.getMessage().contains("World not found")) + if(e.getMessage() != null && e.getMessage().contains("World not found")) { GriefPrevention.AddLogEntry("Failed to load a claim " + files[i].getName() + " because its world isn't loaded (yet?). Please delete the claim file or contact the GriefPrevention developer with information about which plugin(s) you're using to load or create worlds. " + lesserCornerString); inStream.close();