More defensive code.

This commit is contained in:
tastybento 2019-07-28 13:36:17 -07:00
parent 998d5390d1
commit 799decfcac

View File

@ -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);