From 0d956865ed0ac3d18eea774db93f81a6d7d26dd9 Mon Sep 17 00:00:00 2001 From: Oleksandr Moliavko Date: Tue, 2 Jul 2019 14:30:18 +0300 Subject: Added null check to prevent call of getVnfResources() method for null vf object Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko Change-Id: I0c2ea5de5ed9ab55ad78f58f3a68241e7cb2d064 --- .../src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'adapters/mso-openstack-adapters/src/main') diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java index a141f59153..1d73bf21c9 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java @@ -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..."); } -- cgit 1.2.3-korg