diff options
-rw-r--r-- | apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/resources/MicroServiceResource.java | 9 |
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; } |