Skip to content

Commit

Permalink
check when setting timer seconds and allow 0
Browse files Browse the repository at this point in the history
  • Loading branch information
winniehell committed Aug 3, 2012
1 parent 9ae632b commit 59134da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/org/andengine/engine/handler/timer/TimerHandler.java
Expand Up @@ -33,7 +33,7 @@ public TimerHandler(final float pTimerSeconds, final ITimerCallback pTimerCallba
}

public TimerHandler(final float pTimerSeconds, final boolean pAutoReset, final ITimerCallback pTimerCallback) {
if(pTimerSeconds <= 0){
if(pTimerSeconds < 0){
throw new IllegalStateException("pTimerSeconds must be >= 0!");
}

Expand All @@ -55,6 +55,10 @@ public void setAutoReset(final boolean pAutoReset) {
}

public void setTimerSeconds(final float pTimerSeconds) {
if(pTimerSeconds < 0){
throw new IllegalStateException("pTimerSeconds must be >= 0!");
}

this.mTimerSeconds = pTimerSeconds;
}

Expand Down

0 comments on commit 59134da

Please sign in to comment.