From 66e72c393f48b519161fd2b40e7c02434ff0dec8 Mon Sep 17 00:00:00 2001 From: Wagyourtail Date: Mon, 23 Sep 2024 15:52:41 -0500 Subject: [PATCH] also check on response --- .../xyz/wagyourtail/jvmdg/j11/impl/http/HttpClientImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java-api/src/java11/java/xyz/wagyourtail/jvmdg/j11/impl/http/HttpClientImpl.java b/java-api/src/java11/java/xyz/wagyourtail/jvmdg/j11/impl/http/HttpClientImpl.java index 1034557..ab911c8 100644 --- a/java-api/src/java11/java/xyz/wagyourtail/jvmdg/j11/impl/http/HttpClientImpl.java +++ b/java-api/src/java11/java/xyz/wagyourtail/jvmdg/j11/impl/http/HttpClientImpl.java @@ -211,7 +211,9 @@ public void onComplete() { int responseCode = connection.getResponseCode(); headers = new HashMap<>(connection.getHeaderFields()); - cookieHandler.put(var1.uri(), headers); + if (cookieHandler != null) { + cookieHandler.put(var1.uri(), headers); + } headers.remove(null); Version version = J_N_H_HttpClient.Version.HTTP_1_1; HttpResponseInfo info = new HttpResponseInfo(responseCode, new J_N_H_HttpHeaders(headers), version);