Don’t check for the presence of the album image in the album.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 10 Oct 2013 19:31:08 +0000 (21:31 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 10 Oct 2013 19:31:08 +0000 (21:31 +0200)
As the albums are loaded and instantiated before the images are loaded,
this will inevitably fail during loading.

src/main/java/net/pterodactylus/sone/data/AlbumImpl.java

index 93cf2d9..5422812 100644 (file)
@@ -311,7 +311,7 @@ public class AlbumImpl implements Album {
 
                        @Override
                        public Album update() throws IllegalStateException {
-                               checkState(!albumImage.isPresent() || images.containsKey(albumImage.get()), "album image must belong to this album");
+                               checkState(!albumImage.isPresent(), "album image must belong to this album");
                                if (title.isPresent()) {
                                        AlbumImpl.this.title = title.get();
                                }