From 9818bca757ed69ebe919158073d20e1163c7462c Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Thu, 15 Dec 2022 13:23:43 +0100 Subject: [PATCH] Player config storage : only load if file exists --- .../pandacube/lib/paper/players/PaperPlayerConfigStorage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/players/PaperPlayerConfigStorage.java b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/players/PaperPlayerConfigStorage.java index cc6d662..65e50c7 100644 --- a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/players/PaperPlayerConfigStorage.java +++ b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/players/PaperPlayerConfigStorage.java @@ -51,10 +51,12 @@ public class PaperPlayerConfigStorage { private static synchronized void load() throws IOException, InvalidConfigurationException { YamlConfiguration config = new YamlConfiguration(); - config.load(storageFile); data.clear(); playerSortedData.clear(); keySortedData.clear(); + if (!storageFile.exists()) + return; + config.load(storageFile); for (String pIdStr : config.getKeys(false)) { UUID pId; try {