Fixing NPE found out during bindService Testing 01/31601/1
authorFaseela K <faseela.k@ericsson.com>
Fri, 18 Dec 2015 13:02:09 +0000 (18:32 +0530)
committerFaseela K <faseela.k@ericsson.com>
Fri, 18 Dec 2015 13:02:09 +0000 (18:32 +0530)
Change-Id: I713a03e5ca91c2b7464cb79b76cb45ff75fee7d1
Signed-off-by: Faseela K <faseela.k@ericsson.com>
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);