diff options
author | abhishek.c92 <abhishek.c92@samsung.com> | 2022-07-15 11:20:27 +0530 |
---|---|---|
committer | abhishek.c92 <abhishek.c92@samsung.com> | 2022-07-15 11:24:59 +0530 |
commit | 89bf2e721cd43c0acce52e0e6ea509d134be288e (patch) | |
tree | 31688cc29b55fad3f4df89d104360db36a2c2df3 /adaptors/aai-service | |
parent | d3b56a45e948a2e3d0cf8c5514cdaf4e08a0b4fe (diff) |
CCSDK-3721: Fix sonar issues for AAIClientRESTExecutor
Add null check for KeyManagerFactory instance
Issue-ID: CCSDK-3721
Signed-off-by: abhishek.c92 <abhishek.c92@samsung.com>
Change-Id: I783fa1447e2ed1e8655a0364899647d04de565f8
Diffstat (limited to 'adaptors/aai-service')
-rwxr-xr-x | adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java index d3f79db8d..3ededcc54 100755 --- a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java +++ b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java @@ -52,6 +52,7 @@ import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocketFactory; import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.ObjectUtils; import org.onap.ccsdk.sli.adaptors.aai.AAIService.TransactionIdTracker; import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; import org.onap.ccsdk.sli.adaptors.aai.data.ErrorResponse; @@ -160,8 +161,9 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface { } catch (Exception ex) { LOG.error("AAIResource", ex); } - - ctx.init(kmf.getKeyManagers(), null, null); + if (ObjectUtils.anyNotNull(kmf)) { + ctx.init(kmf.getKeyManagers(), null, null); + } CTX = ctx; LOG.debug("SSLContext created"); |