Skip to content

Commit

Permalink
[upnpcontrol] Catch IAE when Album Art URI is invalid (openhab#16597)
Browse files Browse the repository at this point in the history
Fixes openhab#16595

Signed-off-by: Wouter Born <github@maindrain.net>
  • Loading branch information
wborn authored and lo92fr committed Apr 30, 2024
1 parent d798dc1 commit 1c48402
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,12 @@ private void updateMetaDataState(UpnpEntry media) {
if (media.getAlbumArtUri().isEmpty() || media.getAlbumArtUri().contains("DefaultAlbumCover")) {
updateState(ALBUM_ART, UnDefType.UNDEF);
} else {
State albumArt = HttpUtil.downloadImage(media.getAlbumArtUri());
State albumArt = null;
try {
albumArt = HttpUtil.downloadImage(media.getAlbumArtUri());
} catch (IllegalArgumentException e) {
logger.debug("Invalid album art URI: {}", media.getAlbumArtUri(), e);
}
if (albumArt == null) {
logger.debug("Failed to download the content of album art from URL {}", media.getAlbumArtUri());
if (!isCurrent) {
Expand Down

0 comments on commit 1c48402

Please sign in to comment.