checkArgument(image.getAlbum().equals(this), "image must belong to this album");
int oldIndex = imageIds.indexOf(image.getId());
if (oldIndex <= 0) {
- return null;
+ return image;
}
imageIds.remove(image.getId());
imageIds.add(oldIndex - 1, image.getId());
checkArgument(image.getAlbum().equals(this), "image must belong to this album");
int oldIndex = imageIds.indexOf(image.getId());
if ((oldIndex == -1) || (oldIndex >= (imageIds.size() - 1))) {
- return null;
+ return image;
}
imageIds.remove(image.getId());
imageIds.add(oldIndex + 1, image.getId());