aboutsummaryrefslogtreecommitdiffstats
path: root/apiroute/apiroute-service/src/main
diff options
context:
space:
mode:
authorHuabingZhao <zhao.huabing@zte.com.cn>2018-03-12 19:23:23 +0800
committerHuabingZhao <zhao.huabing@zte.com.cn>2018-03-12 19:28:50 +0800
commit556ec2e4d3fa31b96fe0d3f5a842254ad906af68 (patch)
treea11fee723eda7d7d0d62cbd2e35ea2e0df4f4c6f /apiroute/apiroute-service/src/main
parentdcdaf85627b6930ee89ef69991c8780955c4c7dd (diff)
Solve 500 error for deleting service
Change-Id: Iae4c56fe6cbe2009d36dfd451029413b9227c8f7 Issue-ID: MSB-99 MSB-92 Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
Diffstat (limited to 'apiroute/apiroute-service/src/main')
-rw-r--r--apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/resources/MicroServiceResource.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/resources/MicroServiceResource.java b/apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/resources/MicroServiceResource.java
index 7ade6fa..5a582d6 100644
--- a/apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/resources/MicroServiceResource.java
+++ b/apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/resources/MicroServiceResource.java
@@ -326,8 +326,13 @@ public class MicroServiceResource {
* @throws IOException
*/
private Response cloneHttpResponse(CloseableHttpResponse httpResponse) throws IOException {
- String jsonString = EntityUtils.toString(httpResponse.getEntity());
- Response response = Response.status(httpResponse.getStatusLine().getStatusCode()).entity(jsonString).build();
+ Response response;
+ if (httpResponse.getEntity() != null) {
+ String jsonString = EntityUtils.toString(httpResponse.getEntity());
+ response = Response.status(httpResponse.getStatusLine().getStatusCode()).entity(jsonString).build();
+ } else {
+ response = Response.status(httpResponse.getStatusLine().getStatusCode()).build();
+ }
return response;
}