Fix bug introduced by Sonar work 69/44769/1
authorInstrumental <jcgmisc@stl.gathman.org>
Wed, 25 Apr 2018 22:01:52 +0000 (17:01 -0500)
committerInstrumental <jcgmisc@stl.gathman.org>
Wed, 25 Apr 2018 22:03:50 +0000 (17:03 -0500)
Issue-ID: AAF-256
Change-Id: I7885d8fed869893d653b05a09f1aa5f3016aebda
Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfo.java

index 2d252ea..b34d096 100644 (file)
@@ -224,8 +224,8 @@ public class SecurityInfo {
                        }
 
                        TrustManager tms[] = tmf.getTrustManagers();
-                       if(tms != null) {
-                               tm = new X509TrustManager[(tms == null) ? 0 : tms.length];
+                       if(tms != null && tms.length>0) {
+                               tm = new X509TrustManager[tms.length];
                                for(int i = 0; i < tms.length; ++i) {
                                        try {
                                                tm[i] = (X509TrustManager)tms[i];