When authenticaiton succees, a NullPointerException may be triggered if there is no match in portToVlanMap , which will stop aaa from listening to radius server. A try-catch is added here in order to prevent subsequent authentication failure in aaa
Change-Id: Iea0c53ff59ed42f0c369400c155b7d8e14a6748f
diff --git a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/OnosXosIntegrationManager.java b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/OnosXosIntegrationManager.java
index 04dd0b8..df3a29f 100644
--- a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/OnosXosIntegrationManager.java
+++ b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/OnosXosIntegrationManager.java
@@ -340,7 +340,13 @@
}
PortNumber onuPort = newTenant.port().port();
- VlanId subscriberVlan = VlanId.vlanId(portToVlan.get(onuPort.toLong()));
+ VlanId subscriberVlan;
+ try {
+ subscriberVlan = VlanId.vlanId(portToVlan.get(onuPort.toLong()));
+ } catch (NullPointerException npe) {
+ log.error("No matched port in portToVlan map", npe);
+ return newTenant;
+ }
VoltTenant tenantToCreate = VoltTenant.builder()
.withProviderService(providerServiceId)