From 799decfcac69537a911b9c08dc6b8415e6ec9a36 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 28 Jul 2019 13:36:17 -0700 Subject: [PATCH] More defensive code. --- .../bentobox/bentobox/managers/BlueprintsManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/managers/BlueprintsManager.java b/src/main/java/world/bentobox/bentobox/managers/BlueprintsManager.java index c5164dbc9..4555d1ec6 100644 --- a/src/main/java/world/bentobox/bentobox/managers/BlueprintsManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/BlueprintsManager.java @@ -188,9 +188,11 @@ public class BlueprintsManager { for (File file : bundles) { try { BlueprintBundle bb = gson.fromJson(new FileReader(file), BlueprintBundle.class); - blueprintBundles.putIfAbsent(addon, new ArrayList<>()).add(bb); - plugin.log("Loaded Blueprint Bundle '" + bb.getUniqueId() + FOR + addon.getDescription().getName()); - loaded = true; + if (bb != null) { + blueprintBundles.putIfAbsent(addon, new ArrayList<>()).add(bb); + plugin.log("Loaded Blueprint Bundle '" + bb.getUniqueId() + FOR + addon.getDescription().getName()); + loaded = true; + } } catch (Exception e) { plugin.logError("Could not load blueprint bundle " + file.getName() + " " + e.getMessage()); plugin.logStacktrace(e);