Merge "Added newToken null check to prevent crash at newToken.getValue() call"
authorSeshu Kumar M <seshu.kumar.m@huawei.com>
Mon, 5 Aug 2019 11:58:27 +0000 (11:58 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 5 Aug 2019 11:58:27 +0000 (11:58 +0000)
cloudify-client/src/main/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProvider.java

index 2478557..c4dcc89 100644 (file)
@@ -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();