Skip to content

Commit

Permalink
[ZEPPELIN-5436] NPE in ZeppelinClient
Browse files Browse the repository at this point in the history
### 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]>
  • Loading branch information
zjffdu committed Jul 9, 2021
1 parent 2adfbd4 commit 64a3621
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -88,7 +88,9 @@ private void checkResponse(HttpResponse<JsonNode> response) throws Exception {
}
if (response.getStatus() != 200) {
String message = response.getStatusText();
if (response.getBody().getObject().has("message")) {
if (response.getBody() != null &&
response.getBody().getObject() != null &&
response.getBody().getObject().has("message")) {
message = response.getBody().getObject().getString("message");
}
throw new Exception(String.format("Unable to call rest api, status: %s, statusText: %s, message: %s",
Expand Down

0 comments on commit 64a3621

Please sign in to comment.