From f55af80acafadc24d121eefc51f6e0704d0cbc09 Mon Sep 17 00:00:00 2001
From: Puneet Singh <puneet2.singh@aricent.com>
Date: Tue, 2 Feb 2016 13:49:53 +0530
Subject: [PATCH] Update ACL.java

In the event the device manger does not yet know an attachment point for a device, the ACL should detect that and perform a noop. Simply checking the length of the SwitchPort[] returned from the device manger should fix the problem. If the length is zero, return; else, proceed.
---
 .../net/floodlightcontroller/accesscontrollist/ACL.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/main/java/net/floodlightcontroller/accesscontrollist/ACL.java b/src/main/java/net/floodlightcontroller/accesscontrollist/ACL.java
index edfc1015f..439b7bc5b 100644
--- a/src/main/java/net/floodlightcontroller/accesscontrollist/ACL.java
+++ b/src/main/java/net/floodlightcontroller/accesscontrollist/ACL.java
@@ -351,7 +351,11 @@ public class ACL implements IACLService, IFloodlightModule, IDeviceListener {
 
 	@Override
 	public void deviceAdded(IDevice device) {
-		SwitchPort[] switchPort = device.getAttachmentPoints();
+		SwitchPort[] switchPort = device.getAttachmentPoints(); 
+		if (switchPort.length == 0) {
+                        //Device manager does not yet know an attachment point for a device (Bug Fix) 
+                        return;
+                }
 		IPv4Address[] ips = device.getIPv4Addresses();
 		if (ips.length == 0) {
 			// A new no-ip device added
-- 
GitLab