From c04666b43d41447fc9d9f2b9e3fc6ff6c62b695e Mon Sep 17 00:00:00 2001 From: RoboMWM Date: Mon, 24 Sep 2018 01:51:47 -0700 Subject: [PATCH] Fix NPE that occurs when repairing nextClaimID value Very likely I was going to refactor this class, but then stopped since it's abstract and thus can't have any constructor... but apparently I forgot to revert that line. Closes #377 --- src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java b/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java index 9920938..a7844ec 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java @@ -62,7 +62,6 @@ import java.util.regex.Pattern; //singleton class which manages all GriefPrevention data (except for config options) public abstract class DataStore { - private GriefPrevention instance; //in-memory cache for player data protected ConcurrentHashMap playerNameToPlayerDataMap = new ConcurrentHashMap(); @@ -141,9 +140,9 @@ public abstract class DataStore { if (claim.id >= nextClaimID) { - instance.getLogger().severe("nextClaimID was lesser or equal to an already-existing claim ID!\n" + + GriefPrevention.instance.getLogger().severe("nextClaimID was lesser or equal to an already-existing claim ID!\n" + "This usually happens if you ran out of storage space."); - instance.AddLogEntry("Changing nextClaimID from " + nextClaimID + " to " + claim.id, CustomLogEntryTypes.Debug, false); + GriefPrevention.AddLogEntry("Changing nextClaimID from " + nextClaimID + " to " + claim.id, CustomLogEntryTypes.Debug, false); nextClaimID = claim.id + 1; } }