Permalink
Browse files

Merge pull request #156 from winniehell/GLES2-pTimerSeconds_patch

Additional check in TimerHandler.setTimerSeconds.
  • Loading branch information...
Nicolas Gramlich
Nicolas Gramlich committed Aug 3, 2012
2 parents 9ae632b + fccb717 commit e5efa2b5f3c4c7dae9e4efe72384caf0aa817606
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/org/andengine/engine/handler/timer/TimerHandler.java
@@ -34,7 +34,7 @@ public TimerHandler(final float pTimerSeconds, final ITimerCallback pTimerCallba
public TimerHandler(final float pTimerSeconds, final boolean pAutoReset, final ITimerCallback pTimerCallback) {
if(pTimerSeconds <= 0){
- throw new IllegalStateException("pTimerSeconds must be >= 0!");
+ throw new IllegalStateException("pTimerSeconds must be > 0!");
}
this.mTimerSeconds = pTimerSeconds;
@@ -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;
}

0 comments on commit e5efa2b

Please sign in to comment.