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 5e6f6b2482
commit 274ad06665

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();