Don’t try to load properties for an empty list.
[demoscenemusic.git] / 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) {