Skip to content

Commit

Permalink
check for null
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
  • Loading branch information
mherwege committed Jan 9, 2025
1 parent bbec1d1 commit c720f57
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c720f57

Please sign in to comment.