[upnpcontrol] Catch IAE when Album Art URI is invalid (#16597)

Fixes #16595

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born 2024-04-01 09:43:05 +02:00 committed by GitHub
parent ed5bb7d895
commit a9c0f9e936
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1651,7 +1651,12 @@ public class UpnpRendererHandler extends UpnpHandler {
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) {