infobox: consistently require non-negative timer durations
This commit is contained in:
@@ -96,6 +96,7 @@ public class Timer extends InfoBox
|
||||
|
||||
public void setDuration(Duration duration)
|
||||
{
|
||||
Preconditions.checkArgument(!duration.isNegative(), "negative duration");
|
||||
this.duration = duration;
|
||||
endTime = startTime.plus(duration);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user