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>
Signed-off-by: Alexander Drent <Alex@Drent-ict.nl>
  • Loading branch information
wborn authored and adr001db committed May 12, 2024
1 parent 7c3088d commit 480fd2b
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 480fd2b

Please sign in to comment.