From 6523b8927fa73a251309da1f2f6a376fa2a98d96 Mon Sep 17 00:00:00 2001 From: gohai Date: Fri, 27 May 2016 07:15:57 +0200 Subject: [PATCH] Fix Downloader Addresses #4496. Enough to get JRE downloads to work again. --- build/jre/src/Downloader.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/jre/src/Downloader.java b/build/jre/src/Downloader.java index 5c989684e..faef58787 100644 --- a/build/jre/src/Downloader.java +++ b/build/jre/src/Downloader.java @@ -158,8 +158,10 @@ public class Downloader extends Task { } List cookies = headers.get("Set-Cookie"); conn = (HttpURLConnection) new URL(url).openConnection(); - for (String cookie : cookies) { - conn.setRequestProperty("Cookie", cookie); + if (cookies != null) { + for (String cookie : cookies) { + conn.setRequestProperty("Cookie", cookie); + } } conn.setRequestProperty("Cookie", COOKIE); conn.connect();