diff options
Diffstat (limited to 'framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java')
-rw-r--r-- | framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java b/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java index 0a6f9d4c..19c3f70b 100644 --- a/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java +++ b/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java @@ -195,13 +195,16 @@ public class RoutingConfigurationImpl implements RoutingConfigurationService { } BgpConfig bgpConfig = configService.getConfig(routerAppId, BgpConfig.class); - - return bgpConfig.bgpSpeakers().stream() - .flatMap(speaker -> speaker.peers().stream()) - .map(peer -> interfaceService.getMatchingInterface(peer)) - .filter(intf -> intf != null) - .map(intf -> intf.connectPoint()) - .collect(Collectors.toSet()); + if (bgpConfig == null) { + return Collections.emptySet(); + } else { + return bgpConfig.bgpSpeakers().stream() + .flatMap(speaker -> speaker.peers().stream()) + .map(peer -> interfaceService.getMatchingInterface(peer)) + .filter(intf -> intf != null) + .map(intf -> intf.connectPoint()) + .collect(Collectors.toSet()); + } } @Override |