From e6a43de0f9a226b6bf79b376a32c1711276d3763 Mon Sep 17 00:00:00 2001 From: Oleksandr Moliavko Date: Fri, 2 Aug 2019 16:08:18 +0300 Subject: Added newToken null check to prevent crash at newToken.getValue() call Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko Change-Id: Ib338ec2d901fd68d5b04be4423088449546b7e31 --- .../org/onap/so/cloudify/base/client/CloudifyClientTokenProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- cgit 1.2.3-korg