Don’t load properties if there is no object.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 30 Jul 2012 13:58:05 +0000 (15:58 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 30 Jul 2012 13:58:05 +0000 (15:58 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java

index f5b071f..f3d3578 100644 (file)
@@ -808,6 +808,9 @@ public class DataManager {
         *             if a database error occurs
         */
        private <T extends Base> T loadProperties(final T object, final String table, String type) throws DatabaseException {
+               if (object == null) {
+                       return null;
+               }
                Query query = new Query(Type.SELECT, table);
                query.addField(new Field(table + ".PROPERTY"));
                query.addField(new Field(table + ".VALUE"));