diff --git a/src/main/java/com/daemitus/deadbolt/PlayerNameUtil.java b/src/main/java/com/daemitus/deadbolt/PlayerNameUtil.java index 03865c7..e81c1af 100755 --- a/src/main/java/com/daemitus/deadbolt/PlayerNameUtil.java +++ b/src/main/java/com/daemitus/deadbolt/PlayerNameUtil.java @@ -180,8 +180,13 @@ public static long getLastPlayed(String playerName) { protected synchronized static void populateCaseInsensitiveNameToCaseCorrectName() { + // Check if listFiles returns null (ie folder does not exist) + File[] files = playerfolder.listFiles(); + if (files == null) { + return; + } // Populate by removing .dat - for (File playerfile : playerfolder.listFiles()) + for (File playerfile : files) { String filename = playerfile.getName(); String playername = filename.substring(0, filename.length()-4);