From: David ‘Bombe’ Roden Date: Mon, 20 Jul 2015 17:10:31 +0000 (+0200) Subject: Return original album when it can’t be moved X-Git-Tag: 0.9.3^2~15^2~1 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ed7996b85fc4d8b0c442920ff5d29bce5f7d9903;p=Sone.git Return original album when it can’t be moved --- diff --git a/src/main/java/net/pterodactylus/sone/data/impl/AlbumImpl.java b/src/main/java/net/pterodactylus/sone/data/impl/AlbumImpl.java index fa1538d..3488577 100644 --- a/src/main/java/net/pterodactylus/sone/data/impl/AlbumImpl.java +++ b/src/main/java/net/pterodactylus/sone/data/impl/AlbumImpl.java @@ -134,7 +134,7 @@ public class AlbumImpl implements Album { checkArgument(equals(album.getParent()), "album must belong to this album"); int oldIndex = albums.indexOf(album); if (oldIndex <= 0) { - return null; + return album; } albums.remove(oldIndex); albums.add(oldIndex - 1, album); @@ -148,7 +148,7 @@ public class AlbumImpl implements Album { checkArgument(equals(album.getParent()), "album must belong to this album"); int oldIndex = albums.indexOf(album); if ((oldIndex < 0) || (oldIndex >= (albums.size() - 1))) { - return null; + return album; } albums.remove(oldIndex); albums.add(oldIndex + 1, album);