Prevent errors in log when URI host is null (#11893)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
committed by
GitHub
parent
253f36abbf
commit
cf86044580
@@ -267,11 +267,17 @@ public class ChromecastStatusUpdater {
|
|||||||
|
|
||||||
private @Nullable RawType downloadImage(String url) {
|
private @Nullable RawType downloadImage(String url) {
|
||||||
logger.debug("Trying to download the content of URL '{}'", url);
|
logger.debug("Trying to download the content of URL '{}'", url);
|
||||||
|
try {
|
||||||
RawType downloadedImage = HttpUtil.downloadImage(url);
|
RawType downloadedImage = HttpUtil.downloadImage(url);
|
||||||
if (downloadedImage == null) {
|
if (downloadedImage == null) {
|
||||||
logger.debug("Failed to download the content of URL '{}'", url);
|
logger.debug("Failed to download the content of URL '{}'", url);
|
||||||
}
|
}
|
||||||
return downloadedImage;
|
return downloadedImage;
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
// we catch this exception to avoid confusion errors in the log file
|
||||||
|
// see https://github.com/openhab/openhab-core/issues/2494#issuecomment-970162025
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private @Nullable RawType downloadImageFromCache(String url) {
|
private @Nullable RawType downloadImageFromCache(String url) {
|
||||||
|
|||||||
Reference in New Issue
Block a user