Fixing NPE found out during bindService Testing
[vpnservice.git] / interfacemgr / interfacemgr-impl / src / main / java / org / opendaylight / vpnservice / interfacemgr / servicebindings / flowbased / confighelpers / FlowBasedServicesConfigBindHelper.java
index e55da55ea63c42bf64c6546027f5046a7166aec5..0ea2819743f357c6e88ee081fd7cdba51ccb05d1 100644 (file)
@@ -77,7 +77,10 @@ public class FlowBasedServicesConfigBindHelper {
             int vlanId = 0;
             List<MatchInfo> matches = null;
             if (iface.getType().isAssignableFrom(L2vlan.class)) {
-                vlanId = iface.getAugmentation(IfL2vlan.class).getVlanId().getValue();
+                IfL2vlan l2vlan = iface.getAugmentation(IfL2vlan.class);
+                if( l2vlan != null){
+                    vlanId = l2vlan.getVlanId().getValue();
+                }
                 matches = FlowBasedServicesUtils.getMatchInfoForVlanPortAtIngressTable(dpId, portNo, vlanId);
             } else if (iface.getType().isAssignableFrom(Tunnel.class)){
                 matches = FlowBasedServicesUtils.getMatchInfoForTunnelPortAtIngressTable (dpId, portNo, iface);