Don’t throw exceptions when a single “return” would suffice.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index d61211d..9c2cedc 100644 (file)
@@ -731,7 +731,6 @@ public class Core implements IdentityListener, UpdateListener {
        }
 
        /**
-        *      
         * Returns the album with the given ID, creating a new album if no album
         * with the given ID can be found.
         *
@@ -1711,8 +1710,9 @@ public class Core implements IdentityListener, UpdateListener {
                album.setSone(sone);
                if (parent != null) {
                        parent.addAlbum(album);
+               } else {
+                       sone.addAlbum(album);
                }
-               sone.addAlbum(album);
                return album;
        }