Bug 3979: Fix NPE for get-mapping RPC when mapping contains ELP 88/23988/1
authorFlorin Coras <fcoras@cisco.com>
Fri, 10 Jul 2015 11:43:18 +0000 (13:43 +0200)
committerFlorin Coras <fcoras@cisco.com>
Fri, 10 Jul 2015 14:32:58 +0000 (14:32 +0000)
Change-Id: Ie6ec638c0c10e62f7eb8b0aee2b875dc1b10d815
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit e9ce10cd33e357c6070598b5a4e2daca45cb0c33)

mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/lisp/MapResolver.java

index 16f65591c9062eb6ff1d0ec20fc4de6f0293eee1..408b3b03fbdeceb28ba286a51e29769c3b1e3111 100644 (file)
@@ -146,8 +146,8 @@ public class MapResolver extends AbstractLispComponent implements IMapResolverAs
             for (LocatorRecord record : locatorObject.getRecords()) {
                 LispAddressContainer container = record.getLispAddressContainer();
 
-                // For non-ELP RLOCs, or when ELP policy is default, just add the locator and be done
-                if ((!(container.getAddress() instanceof LcafTrafficEngineering)) || elpPolicy.equalsIgnoreCase("default")) {
+                // For non-ELP RLOCs, or when ELP policy is default, or itrRlocs is null, just add the locator and be done
+                if ((!(container.getAddress() instanceof LcafTrafficEngineering)) || elpPolicy.equalsIgnoreCase("default") || itrRlocs == null) {
                     recordBuilder.getLocatorRecord().add(
                             new LocatorRecordBuilder().setLocalLocator(record.isLocalLocator()).setRlocProbed(record.isRlocProbed())
                                     .setWeight(record.getWeight()).setPriority(record.getPriority()).setMulticastWeight(record.getMulticastWeight())