Fix for where initial database table is blank.

This commit is contained in:
tastybento 2017-10-22 17:51:50 -07:00
parent f1842e2141
commit e47293a883

View File

@ -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<Levels>) 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) {