From 274ad06665d396419e10ae045f4bc08666bb8e89 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 18 May 2013 17:57:05 +0100 Subject: [PATCH] Fix null when trying to tempban players in console for times longer than max ban. --- .../src/com/earth2me/essentials/commands/Commandtempban.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java index b0384d5d0..5231f90c7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -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();