Added fix for potential nullpointerexception 12/73912/1
authorChandan Ghosh <cghosh12@in.ibm.com>
Thu, 29 Nov 2018 11:51:37 +0000 (17:21 +0530)
committerChandan Ghosh <cghosh12@in.ibm.com>
Thu, 29 Nov 2018 11:51:44 +0000 (17:21 +0530)
Added fix for potential nullpointerexception reported in sonar

Issue-ID: CCSDK-767
Change-Id: I92a363ded79ea282c24216b525c8567492a53e17
Signed-off-by: Chandan Ghosh <cghosh12@in.ibm.com>
aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java

index bfed619..78b0f0e 100755 (executable)
@@ -285,7 +285,9 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
                 LOG.error("AAIResource", ex);
             }
 
-            ctx.init(kmf.getKeyManagers(), null, null);
+            if(null!=kmf) {
+               ctx.init(kmf.getKeyManagers(), null, null);
+            }
             config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, new HTTPSProperties( new HostnameVerifier() {
                     @Override
                     public boolean verify( String s, SSLSession sslSession ) {