diff --git a/bundles/org.openhab.core.io.net/src/main/java/org/openhab/core/io/net/http/HttpUtil.java b/bundles/org.openhab.core.io.net/src/main/java/org/openhab/core/io/net/http/HttpUtil.java index 71a85009c6f..d7ab50b5778 100644 --- a/bundles/org.openhab.core.io.net/src/main/java/org/openhab/core/io/net/http/HttpUtil.java +++ b/bundles/org.openhab.core.io.net/src/main/java/org/openhab/core/io/net/http/HttpUtil.java @@ -152,6 +152,10 @@ public static String executeUrl(String httpMethod, String url, Properties httpHe public static String executeUrl(String httpMethod, String url, Properties httpHeaders, InputStream content, String contentType, int timeout, String proxyHost, Integer proxyPort, String proxyUser, String proxyPassword, String nonProxyHosts) throws IOException { + if (url == null) { + LOGGER.debug("Execute url failed: no url provided"); + return null; + } ContentResponse response = executeUrlAndGetReponse(httpMethod, url, httpHeaders, content, contentType, timeout, proxyHost, proxyPort, proxyUser, proxyPassword, nonProxyHosts); String encoding = response.getEncoding() != null ? response.getEncoding().replace("\"", "").trim() @@ -438,6 +442,11 @@ public static RawType downloadData(String url, String contentTypeRegex, boolean */ public static RawType downloadData(String url, String contentTypeRegex, boolean scanTypeInContent, long maxContentLength, int timeout) { + if (url == null) { + LOGGER.debug("Media download failed: no url provided"); + return null; + } + final ProxyParams proxyParams = prepareProxyParams(); RawType rawData = null;