diff options
author | Oleksandr Moliavko <o.moliavko@samsung.com> | 2019-07-01 12:11:50 +0300 |
---|---|---|
committer | Oleksandr Moliavko <o.moliavko@samsung.com> | 2019-07-01 12:11:50 +0300 |
commit | cabd51660c3c8ec52e329027179f5c6cabb03aca (patch) | |
tree | 90444b9ab0ab507414dfe2751b4113d2da619183 /cloudify-client/src/main | |
parent | 9306c021d9434f4ce8d0dfa9dd9ecb63974f11e6 (diff) |
Added check for null response to prevent crash at
response.getEntity() method call.
Issue-ID: SO-1841
Signed-off-by: Oleksandr Moliavko <o.moliavko@samsung.com>
Change-Id: Id796f4426f33cf419bbe5ed07500452ac0c7c775
Diffstat (limited to 'cloudify-client/src/main')
-rw-r--r-- | cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClient.java | 5 |
1 files changed, 5 insertions, 0 deletions
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> T execute(CloudifyRequest<T> request) { CloudifyResponse response = request(request); + + if (null == response) { + return null; + } + return (request.returnType() != null && request.returnType() != Void.class) ? response.getEntity(request.returnType()) : null; |