From cabd51660c3c8ec52e329027179f5c6cabb03aca Mon Sep 17 00:00:00 2001 From: Oleksandr Moliavko Date: Mon, 1 Jul 2019 12:11:50 +0300 Subject: Added check for null response to prevent crash at response.getEntity() method call. Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko Change-Id: Id796f4426f33cf419bbe5ed07500452ac0c7c775 --- .../main/java/org/onap/so/cloudify/base/client/CloudifyClient.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cloudify-client/src/main/java/org/onap') diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java index 1893590106..3bd646fada 100644 --- a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java +++ b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java @@ -95,6 +95,11 @@ public class CloudifyClient { */ public T execute(CloudifyRequest request) { CloudifyResponse response = request(request); + + if (null == response) { + return null; + } + return (request.returnType() != null && request.returnType() != Void.class) ? response.getEntity(request.returnType()) : null; -- cgit 1.2.3-korg