From ed7996b85fc4d8b0c442920ff5d29bce5f7d9903 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 20 Jul 2015 19:10:31 +0200 Subject: [PATCH] =?utf8?q?Return=20original=20album=20when=20it=20can?= =?utf8?q?=E2=80=99t=20be=20moved?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/data/impl/AlbumImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.7.4