Don’t try to load properties for an empty list.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 31 Jul 2012 10:50:42 +0000 (12:50 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 31 Jul 2012 10:50:42 +0000 (12:50 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java

index a11027c..eb5e1c7 100644 (file)
@@ -953,6 +953,9 @@ public class DataManager {
         *             if a database error occurs
         */
        private <T extends Base> List<T> loadProperties(List<T> objects, final String table, final String type) throws DatabaseException {
+               if (objects.isEmpty()) {
+                       return objects;
+               }
                final Map<String, T> objectMap = new HashMap<String, T>();
                final Set<String> firstObjects = new HashSet<String>();
                for (T object : objects) {