From 32ac7f7f7140e5d837fbe9090c4f934ee0dba1c4 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 17 Jul 2021 18:16:34 +0200 Subject: [PATCH] Fix crash when a server returns a null location --- .../antennapod/core/service/download/AntennapodHttpClient.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java index 93a58af06..bca3792b0 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java @@ -77,6 +77,9 @@ public class AntennapodHttpClient { if (response.code() == HttpURLConnection.HTTP_MOVED_PERM || response.code() == StatusLine.HTTP_PERM_REDIRECT) { String location = response.header("Location"); + if (location == null) { + return response; + } if (location.startsWith("/")) { // URL is not absolute, but relative HttpUrl url = request.url(); location = url.scheme() + "://" + url.host() + location;