Bug 2026: Fix for Neutron REST API NullPointer exception on POST Port when no fisxed... 61/11461/1
authorVina Ermagan <vermagan@cisco.com>
Mon, 22 Sep 2014 22:28:00 +0000 (15:28 -0700)
committerVina Ermagan <vermagan@cisco.com>
Mon, 22 Sep 2014 22:35:46 +0000 (15:35 -0700)
Change-Id: I80e6435add3e0a07f28dbdf37911cd2bc8b263d0
Signed-off-by: Vina Ermagan <vermagan@cisco.com>
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronPortInterface.java

index 6dc0e46..3294474 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();