Fix NPE introduced by gerrit 18883
Change-Id: I1ba7956d114114a6084c252621c42cea55dfe731
diff --git a/apps/routing/fpm/app/src/main/java/org/onosproject/routing/fpm/FpmManager.java b/apps/routing/fpm/app/src/main/java/org/onosproject/routing/fpm/FpmManager.java
index d3fa597..cf3b7d3 100644
--- a/apps/routing/fpm/app/src/main/java/org/onosproject/routing/fpm/FpmManager.java
+++ b/apps/routing/fpm/app/src/main/java/org/onosproject/routing/fpm/FpmManager.java
@@ -460,8 +460,11 @@
IpPrefix prefix = IpPrefix.valueOf(dstAddress, rtNetlink.dstLength());
// Ignore routes that we sent.
- if (gateway != null && ((prefix.isIp4() && (pdPushNextHopIPv4.contains(gateway))) ||
- pdPushNextHopIPv6.contains(gateway))) {
+ if (gateway != null && (
+ (prefix.isIp4() && pdPushNextHopIPv4 != null &&
+ pdPushNextHopIPv4.contains(gateway.getIp4Address())) ||
+ (prefix.isIp6() && pdPushNextHopIPv6 != null &&
+ pdPushNextHopIPv6.contains(gateway.getIp6Address())))) {
if (routeInDhcpStore(prefix) || routeInRipStore(prefix)) {
return;
}