Added guard to avoid the case where count == 0.

This commit is contained in:
Simone Bordet 2017-08-22 15:47:17 +02:00
parent 927fe9ec44
commit 1711642309
1 changed files with 2 additions and 0 deletions

View File

@ -45,6 +45,8 @@ public class CountingCallback extends Callback.Nested
public CountingCallback(Callback callback, int count)
{
super(callback);
if (count < 1)
throw new IllegalArgumentException();
this.count = new AtomicInteger(count);
}