Skip to content

Commit

Permalink
Add protection code in TryToComplete task, to avoid negative numbers …
Browse files Browse the repository at this point in the history
…in max completion times.
  • Loading branch information
BONNe committed Jun 16, 2019
1 parent 4e2181f commit ca5ff50
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,11 @@ private ChallengeResult checkIfCanCompleteChallenge(int maxTimes)
this.user.sendMessage("challenges.errors.not-deployed");
result = EMPTY_RESULT;
}
else if (maxTimes < 1)
{
this.user.sendMessage("challenges.errors.not-valid-integer");
result = EMPTY_RESULT;
}
else if (Util.getWorld(this.world) != Util.getWorld(this.user.getWorld()) ||
!this.challenge.getUniqueId().startsWith(Util.getWorld(this.world).getName()))
{
Expand Down

0 comments on commit ca5ff50

Please sign in to comment.