fix a sonar complaints NullPointerException 25/36425/5
authorlding7 <liang.ding@intel.com>
Mon, 19 Mar 2018 06:49:00 +0000 (14:49 +0800)
committerOren Kleks <orenkle@amdocs.com>
Mon, 9 Apr 2018 06:28:39 +0000 (06:28 +0000)
a bug from https://sonar.onap.org/project/issues?id=org.openecomp.sdc%3Asdc-main%3A1.2.0-SNAPSHOT&open=AWIFjPcyRGy6eclHC_RW&resolved=false&types=BUG

Change-Id: Ibe0e1e457edb4d474ba4a37894f066f5a0b24361
Issue-ID: SDC-1145
Signed-off-by: lding7 <liang.ding@intel.com>
openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java

index b962a79..4618d28 100644 (file)
@@ -589,6 +589,7 @@ public class CandidateServiceImpl implements CandidateService {
                              FilesDataStructure structure, int inx,
                              Map<String, List<ErrorMessage>> uploadErrors) {
     for (HeatStructureTree volume : volumeSet) {
+      Objects.requireNonNull(volume, "volume cannot be null!");
       if (inx++ > 0) {
         ErrorsUtil.addStructureErrorToErrorMap(SdcCommon.UPLOAD_FILE,
             new ErrorMessage(ErrorLevel.WARNING,