Committed by
Gerrit Code Review
Fixed IoB exception in null provider.
Change-Id: I1e2e6ef7068d5e251f30ac6c10d17f24f611124a
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -137,7 +137,7 @@ class NullPacketProvider extends NullProviders.AbstractNullProvider | ... | @@ -137,7 +137,7 @@ class NullPacketProvider extends NullProviders.AbstractNullProvider |
137 | @Override | 137 | @Override |
138 | public void run(Timeout to) { | 138 | public void run(Timeout to) { |
139 | if (!devices.isEmpty() && !to.isCancelled()) { | 139 | if (!devices.isEmpty() && !to.isCancelled()) { |
140 | - sendEvent(devices.get(Math.max(currentDevice, devices.size()))); | 140 | + sendEvent(devices.get(Math.min(currentDevice, devices.size() - 1))); |
141 | currentDevice = (currentDevice + 1) % devices.size(); | 141 | currentDevice = (currentDevice + 1) % devices.size(); |
142 | timeout = timer.newTimeout(to.getTask(), delay, TimeUnit.MILLISECONDS); | 142 | timeout = timer.newTimeout(to.getTask(), delay, TimeUnit.MILLISECONDS); |
143 | } | 143 | } | ... | ... |
-
Please register or login to post a comment