BUG-3664 Fix NPE caused by null AbstractRouteEntry 87/22587/6
authorClaudio D. Gasparini <cgaspari@cisco.com>
Mon, 15 Jun 2015 13:35:44 +0000 (15:35 +0200)
committerClaudio D. Gasparini <cgaspari@cisco.com>
Tue, 16 Jun 2015 11:31:16 +0000 (13:31 +0200)
When we tried to get effectiveAttributes from an AbstractRouteEntry
which is null will cause a NPE, since it doesnt contain any attribute.
Fix by check this case.

Change-Id: I311743a165373ee2da4bd4f73e2d468023e445ad
Signed-off-by: Claudio D. Gasparini <cgaspari@cisco.com>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/PeerExportGroup.java

index d57a10f9b1c6432ff9b33c0da5e6a86b9f32c392..e4777978b517096b1eadc20ba2f239e3ced8d497 100644 (file)
@@ -31,7 +31,7 @@ final class PeerExportGroup {
     }
 
     ContainerNode effectiveAttributes(final PeerId sourcePeerId, final ContainerNode attributes) {
-        return policy.effectiveAttributes(peerRoles.get(sourcePeerId), attributes);
+        return attributes == null ? null :  policy.effectiveAttributes(peerRoles.get(sourcePeerId), attributes);
     }
 
     Collection<Entry<PeerId, YangInstanceIdentifier>> getPeers() {