Skip to content

Commit 64a3621

Browse files
committed
[ZEPPELIN-5436] NPE in ZeppelinClient
### What is this PR for? Minor PR to fix NPE in ZeppelinClient ### What type of PR is it? [Improvement ] ### Todos * [ ] - Task ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-5436 ### How should this be tested? * CI pass ### Screenshots (if appropriate) ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Jeff Zhang <[email protected]> Closes #4167 from zjffdu/ZEPPELIN-5436 and squashes the following commits: 100e66a [Jeff Zhang] [ZEPPELIN-5436] NPE in ZeppelinClient (cherry picked from commit 593a5cc) Signed-off-by: Jeff Zhang <[email protected]>
1 parent 2adfbd4 commit 64a3621

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

zeppelin-client/src/main/java/org/apache/zeppelin/client/ZeppelinClient.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ private void checkResponse(HttpResponse<JsonNode> response) throws Exception {
8888
}
8989
if (response.getStatus() != 200) {
9090
String message = response.getStatusText();
91-
if (response.getBody().getObject().has("message")) {
91+
if (response.getBody() != null &&
92+
response.getBody().getObject() != null &&
93+
response.getBody().getObject().has("message")) {
9294
message = response.getBody().getObject().getString("message");
9395
}
9496
throw new Exception(String.format("Unable to call rest api, status: %s, statusText: %s, message: %s",

0 commit comments

Comments
 (0)