Added null check to prevent call of getVnfResources() method 74/90774/1
authorOleksandr Moliavko <o.moliavko@samsung.com>
Tue, 2 Jul 2019 11:30:18 +0000 (14:30 +0300)
committerOleksandr Moliavko <o.moliavko@samsung.com>
Tue, 2 Jul 2019 11:30:18 +0000 (14:30 +0300)
for null vf object

Issue-ID: SO-1841
Signed-off-by: Oleksandr Moliavko <o.moliavko@samsung.com>
Change-Id: I0c2ea5de5ed9ab55ad78f58f3a68241e7cb2d064

adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java

index a141f59..1d73bf2 100644 (file)
@@ -843,8 +843,10 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             // Add version check
             // First - see if it's in the VnfResource record
             // if we have a vf Module - then we have to query to get the VnfResource record.
-            if (!oldWay && vf.getVnfResources() != null) {
-                vnfResource = vf.getVnfResources();
+            if (!oldWay) {
+                if (vf != null) {
+                    vnfResource = vf.getVnfResources();
+                }
                 if (vnfResource == null) {
                     logger.debug("Unable to find vnfResource will not error for now...");
                 }