Update Commanddeljail.java (#2002) @montlikadani

When the user entered a word to delete the jail, deleted it, but removed anything because no jail existed.
This commit is contained in:
montlikadani 2018-05-26 21:40:45 +02:00 committed by md678685
parent 030eb3375b
commit 2ff29dab80
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,10 @@ public class Commanddeljail extends EssentialsCommand {
throw new NotEnoughArgumentsException();
}
if (ess.getJails().getJail(args[0]) == null) {
throw new Exception(tl("jailNotExist"));
}
ess.getJails().removeJail(args[0]);
sender.sendMessage(tl("deleteJail", args[0]));
}