1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-17 20:11:21 +02:00

Fix null when trying to tempban players in console for times longer than max ban.

This commit is contained in:
KHobbits
2013-05-18 17:57:05 +01:00
parent ed515dc187
commit a5ec8edf6b

View File

@@ -46,7 +46,8 @@ public class Commandtempban extends EssentialsCommand
final long banTimestamp = Util.parseDateDiff(time, true);
final long maxBanLength = ess.getSettings().getMaxTempban() * 1000;
if (maxBanLength > 0 && ((banTimestamp - GregorianCalendar.getInstance().getTimeInMillis()) > maxBanLength) && !(ess.getUser(sender).isAuthorized("essentials.tempban.unlimited")))
if (maxBanLength > 0 && ((banTimestamp - GregorianCalendar.getInstance().getTimeInMillis()) > maxBanLength)
&& sender instanceof Player && !(ess.getUser(sender).isAuthorized("essentials.tempban.unlimited")))
{
sender.sendMessage(_("oversizedTempban"));
throw new NoChargeException();