From: David ‘Bombe’ Roden Date: Mon, 30 Jul 2012 13:58:05 +0000 (+0200) Subject: Don’t load properties if there is no object. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=51130ce0f519aa3ac648999413e76558679ee182;p=demoscenemusic.git Don’t load properties if there is no object. --- diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java index f5b071f..f3d3578 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java @@ -808,6 +808,9 @@ public class DataManager { * if a database error occurs */ private 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"));