From e47293a883dffb1fcf2e597a5f5531d496f4828f Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 22 Oct 2017 17:51:50 -0700 Subject: [PATCH] Fix for where initial database table is blank. --- Level/src/bskyblock/addin/level/Level.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Level/src/bskyblock/addin/level/Level.java b/Level/src/bskyblock/addin/level/Level.java index d6fb0aa..0c5c757 100644 --- a/Level/src/bskyblock/addin/level/Level.java +++ b/Level/src/bskyblock/addin/level/Level.java @@ -60,8 +60,12 @@ public class Level extends JavaPlugin { database = BSBDatabase.getDatabase(); // Set up the database handler to store and retrieve Island classes handler = (AbstractDatabaseHandler) database.getHandler(bSkyBlock, Levels.class); + levelsDatabase = new Levels(); try { levelsDatabase = handler.loadObject("addon-levels"); + if (levelsDatabase == null) { + levelsDatabase = new Levels(); + } } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException | ClassNotFoundException | IntrospectionException | SQLException e) {