From 112da8ca7460b27d97bfe342cc81f7253f566a35 Mon Sep 17 00:00:00 2001 From: Dana Kutenicsova Date: Mon, 23 Mar 2015 13:57:05 +0100 Subject: [PATCH] Fixed NPE in BGPPeer. Change-Id: Icf4f9ab08f95ff9a878634d9f00033efca0534b0 Signed-off-by: Dana Kutenicsova --- .../java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.36.6