summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2019-08-21 13:24:58 +0000
committerGerrit Code Review <gerrit@onap.org>2019-08-21 13:24:58 +0000
commitd71a9c0da606fb8bb3fe39de438562a9dd2304a5 (patch)
treebae03f3342c4367e7e9e88f30ff7a6d35720fff3
parent4ec24592f5dfb1449f35ab48d3100a428a4f5e9e (diff)
parentc14891d3abe7e879596c8eba25f216cabc2b4c7c (diff)
Merge "Added null check for httpResponse to prevent crash at throwing exception"
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java
index e1992d98ca..ba6a5911b7 100644
--- a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java
+++ b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java
@@ -232,8 +232,12 @@ public class HttpClientConnector implements CloudifyClientConnector {
}
// Get here on an error response (4XX-5XX)
- throw new CloudifyResponseException(httpResponse.getStatusLine().getReasonPhrase(),
- httpResponse.getStatusLine().getStatusCode(), httpClientResponse);
+ if (httpResponse != null) {
+ throw new CloudifyResponseException(httpResponse.getStatusLine().getReasonPhrase(),
+ httpResponse.getStatusLine().getStatusCode(), httpClientResponse);
+ } else {
+ throw new CloudifyResponseException("Null httpResponse", 0, httpClientResponse);
+ }
}
}