From: David ‘Bombe’ Roden Date: Fri, 23 Sep 2011 09:42:18 +0000 (+0200) Subject: Return an image if an invalid album image ID is set. X-Git-Tag: 0.7^2~2^2~26 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=8ded406fabed389e0f9dc304232f2ab7f3cd65d7;p=Sone.git Return an image if an invalid album image ID is set. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Album.java b/src/main/java/net/pterodactylus/sone/data/Album.java index ab5822b..88029e1 100644 --- a/src/main/java/net/pterodactylus/sone/data/Album.java +++ b/src/main/java/net/pterodactylus/sone/data/Album.java @@ -25,6 +25,7 @@ import java.util.UUID; import net.pterodactylus.util.collection.Mapper; import net.pterodactylus.util.collection.Mappers; +import net.pterodactylus.util.object.Default; import net.pterodactylus.util.validation.Validation; /** @@ -251,7 +252,7 @@ public class Album implements Fingerprintable { if (albumImage == null) { return null; } - return images.get(albumImage); + return Default.forNull(images.get(albumImage), images.values().iterator().next()); } /**