commit | cabd51660c3c8ec52e329027179f5c6cabb03aca | [log] [tgz] |
---|---|---|
author | Oleksandr Moliavko <o.moliavko@samsung.com> | Mon Jul 01 12:11:50 2019 +0300 |
committer | Oleksandr Moliavko <o.moliavko@samsung.com> | Mon Jul 01 12:11:50 2019 +0300 |
tree | 90444b9ab0ab507414dfe2751b4113d2da619183 | |
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
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 1893590..3bd646f 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 <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;