Added newToken null check to prevent crash at 73/92573/1
authorOleksandr Moliavko <o.moliavko@samsung.com>
Fri, 2 Aug 2019 13:08:18 +0000 (16:08 +0300)
committerOleksandr Moliavko <o.moliavko@samsung.com>
Fri, 2 Aug 2019 13:08:18 +0000 (16:08 +0300)
newToken.getValue() call

Issue-ID: SO-1841
Signed-off-by: Oleksandr Moliavko <o.moliavko@samsung.com>
Change-Id: Ib338ec2d901fd68d5b04be4423088449546b7e31

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();