fix: add check for null in getVnfcInstanceFromServer
@@ -1423,6 +1423,7 @@ public class GenericVIM extends Vim {
Map<String, String> floatingIps,
VirtualNetworkFunctionRecord vnfr) {
VNFCInstance vnfcInstance = new VNFCInstance();
+ if (server != null) {
vnfcInstance.setHostname(hostname);
vnfcInstance.setVc_id(server.getExtId());
vnfcInstance.setVim_id(vimInstance.getId());
@@ -1431,8 +1432,10 @@ public class GenericVIM extends Vim {
for (VNFDConnectionPoint connectionPoint : vnfComponent.getConnection_point()) {
VNFDConnectionPoint connectionPoint_vnfci = new VNFDConnectionPoint();
- connectionPoint_vnfci.setVirtual_link_reference(connectionPoint.getVirtual_link_reference());
+ connectionPoint_vnfci.setVirtual_link_reference(
+ connectionPoint.getVirtual_link_reference());
connectionPoint_vnfci.setType(connectionPoint.getType());
+ if (server.getFloatingIps() != null)
for (Entry<String, String> entry : server.getFloatingIps().entrySet())
if (entry.getKey().equals(connectionPoint.getVirtual_link_reference()))
connectionPoint_vnfci.setFloatingIp(entry.getValue());
@@ -1464,7 +1467,7 @@ public class GenericVIM extends Vim {
vnfr.getVnf_address().add(ip1);
}
}
-
+ }
return vnfcInstance;
}
}
