From 0e5e48f76389de43b7df58f95cc049d63240155f Mon Sep 17 00:00:00 2001 From: Dan Cunningham Date: Tue, 24 Dec 2024 12:10:48 -0800 Subject: [PATCH] [upnpcontrol] Fix `IllegalArgumentException` when downloading album art (#17965) * Stip whitespace from album art URI Signed-off-by: Dan Cunningham --- .../upnpcontrol/internal/handler/UpnpRendererHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpRendererHandler.java b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpRendererHandler.java index 0ff5a145a34..6f0165ddb10 100644 --- a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpRendererHandler.java +++ b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpRendererHandler.java @@ -1648,12 +1648,12 @@ public class UpnpRendererHandler extends UpnpHandler { } if (!(isCurrent && (media.getAlbumArtUri().isEmpty() || media.getAlbumArtUri().contains("DefaultAlbumCover")))) { - if (media.getAlbumArtUri().isEmpty() || media.getAlbumArtUri().contains("DefaultAlbumCover")) { + if (media.getAlbumArtUri().isBlank() || media.getAlbumArtUri().contains("DefaultAlbumCover")) { updateState(ALBUM_ART, UnDefType.UNDEF); } else { State albumArt = null; try { - albumArt = HttpUtil.downloadImage(media.getAlbumArtUri()); + albumArt = HttpUtil.downloadImage(media.getAlbumArtUri().trim()); } catch (IllegalArgumentException e) { logger.debug("Invalid album art URI: {}", media.getAlbumArtUri(), e); }