Skip to content

Commit 4e6f04d

Browse files
author
Ryan Smith
committed
Fix a NullPointerException in JsonClientFilter.
1 parent 51075a4 commit 4e6f04d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/github/dockerjava/client/utils/JsonClientFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public ClientResponse handle(ClientRequest cr) {
1616
// Call the next filter
1717
ClientResponse resp = getNext().handle(cr);
1818
String respContentType = resp.getHeaders().getFirst("Content-Type");
19-
if (respContentType.startsWith("text/plain")) {
19+
if (respContentType!= null && respContentType.startsWith("text/plain")) {
2020
String newContentType = "application/json" + respContentType.substring(10);
2121
resp.getHeaders().putSingle("Content-Type", newContentType);
2222
}

0 commit comments

Comments
 (0)