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

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;