Bug 2026: Fix for Neutron REST API NullPointer exception on POST Port when no fisxed...
[controller.git] / opendaylight / networkconfiguration / neutron / implementation / src / main / java / org / opendaylight / controller / networkconfig / neutron / implementation / NeutronPortInterface.java
index 6dc0e46b61749673b799c7d94efb91240658f4e3..3294474b49480ed9153bcef9bf2d753d6c505be8 100644 (file)
@@ -233,6 +233,9 @@ public class NeutronPortInterface implements INeutronPortCRUD, IConfigurationCon
         portDB.putIfAbsent(input.getID(), input);
         // if there are no fixed IPs, allocate one for each subnet in the network
         INeutronSubnetCRUD systemCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
+        if (input.getFixedIPs() == null){
+           input.setFixedIPs(new ArrayList<Neutron_IPs>());
+        }
         if (input.getFixedIPs().size() == 0) {
             List<Neutron_IPs> list = input.getFixedIPs();
             Iterator<NeutronSubnet> subnetIterator = systemCRUD.getAllSubnets().iterator();