summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-05-18 17:57:05 +0100
committerKHobbits <rob@khobbits.co.uk>2013-05-18 17:57:05 +0100
commit18b9fe6a5e0a518d4223b6f4e2343bd0385dad23 (patch)
tree622ae9cec0bb9241c1dbc85ce4ce666c65ea60f4
parent174e12d897791dfc385451edbd56b33c3b7af26f (diff)
downloadEssentials-18b9fe6a5e0a518d4223b6f4e2343bd0385dad23.tar
Essentials-18b9fe6a5e0a518d4223b6f4e2343bd0385dad23.tar.gz
Essentials-18b9fe6a5e0a518d4223b6f4e2343bd0385dad23.tar.lz
Essentials-18b9fe6a5e0a518d4223b6f4e2343bd0385dad23.tar.xz
Essentials-18b9fe6a5e0a518d4223b6f4e2343bd0385dad23.zip
Fix null when trying to tempban players in console for times longer than max ban.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtempban.java3
1 files changed, 2 insertions, 1 deletions
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();