From: Dana Kutenicsova Date: Mon, 23 Mar 2015 12:57:05 +0000 (+0100) Subject: Fixed NPE in BGPPeer. X-Git-Tag: release/lithium~153 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=112da8ca7460b27d97bfe342cc81f7253f566a35;p=bgpcep.git Fixed NPE in BGPPeer. Change-Id: Icf4f9ab08f95ff9a878634d9f00033efca0534b0 Signed-off-by: Dana Kutenicsova --- diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java index 76e70e0bc0..71dc743460 100644 --- a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java +++ b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java @@ -119,7 +119,7 @@ public class BGPPeer implements ReusableBGPPeer, Peer, AutoCloseable, BGPPeerRun MpReachNlri mpReach = null; if (message.getNlri() != null) { mpReach = prefixesToMpReach(message); - } else if (attrs.getAugmentation(PathAttributes1.class) != null) { + } else if (attrs != null && attrs.getAugmentation(PathAttributes1.class) != null) { mpReach = attrs.getAugmentation(PathAttributes1.class).getMpReachNlri(); } if (mpReach != null) { @@ -129,7 +129,7 @@ public class BGPPeer implements ReusableBGPPeer, Peer, AutoCloseable, BGPPeerRun MpUnreachNlri mpUnreach = null; if (message.getWithdrawnRoutes() != null) { mpUnreach = prefixesToMpUnreach(message); - } else if (attrs.getAugmentation(PathAttributes2.class) != null) { + } else if (attrs != null && attrs.getAugmentation(PathAttributes2.class) != null) { mpUnreach = attrs.getAugmentation(PathAttributes2.class).getMpUnreachNlri(); } if (mpUnreach != null) {