Fixed when the mail has already cleared (#2063)

This commit is contained in:
montlikadani 2019-04-18 19:18:42 +02:00 committed by Joseph Hirschfeld
parent eac1e9b574
commit 3f5f9cc717
1 changed files with 5 additions and 0 deletions

View File

@ -87,6 +87,11 @@ public class Commandmail extends EssentialsCommand {
return;
}
if (args.length >= 1 && "clear".equalsIgnoreCase(args[0])) {
if (user.getMails() == null || user.getMails().isEmpty()) {
user.sendMessage(tl("noMail"));
throw new NoChargeException();
}
user.setMails(null);
user.sendMessage(tl("mailCleared"));
return;