Fixed IoB exception in null provider.

Change-Id: I1e2e6ef7068d5e251f30ac6c10d17f24f611124a
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/NullPacketProvider.java b/providers/null/src/main/java/org/onosproject/provider/nil/NullPacketProvider.java
index 674b33f..07a137e 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/NullPacketProvider.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/NullPacketProvider.java
@@ -137,7 +137,7 @@
         @Override
         public void run(Timeout to) {
             if (!devices.isEmpty() && !to.isCancelled()) {
-                sendEvent(devices.get(Math.max(currentDevice, devices.size())));
+                sendEvent(devices.get(Math.min(currentDevice, devices.size() - 1)));
                 currentDevice = (currentDevice + 1) % devices.size();
                 timeout = timer.newTimeout(to.getTask(), delay, TimeUnit.MILLISECONDS);
             }