summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksandr Moliavko <o.moliavko@samsung.com>2019-08-02 16:08:18 +0300
committerOleksandr Moliavko <o.moliavko@samsung.com>2019-08-02 16:08:18 +0300
commite6a43de0f9a226b6bf79b376a32c1711276d3763 (patch)
tree718862982360e12fc97712b04513e8ebc099a881
parent8b02fbc54e6db36d969b233d136f90b8d6615f80 (diff)
Added newToken null check to prevent crash at
newToken.getValue() call Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko <o.moliavko@samsung.com> Change-Id: Ib338ec2d901fd68d5b04be4423088449546b7e31
-rw-r--r--cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProvider.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProvider.java b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProvider.java
index 2478557afc..c4dcc89d0b 100644
--- a/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProvider.java
+++ b/cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProvider.java
@@ -59,7 +59,9 @@ public class CloudifyClientTokenProvider implements CloudifyTokenProvider {
tokenRequest.setBasicAuthentication(user, password);
Token newToken = tokenRequest.execute();
- token = newToken.getValue();
+ if (newToken != null) {
+ token = newToken.getValue();
+ }
if (expiration == null) {
expiration = new Date();