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

Fix NPE in /kill when used from console. Thanks Necrodoom

This commit is contained in:
KHobbits
2013-08-18 21:04:19 +01:00
parent 92a2244650
commit b8cdd7d1f7

View File

@@ -32,7 +32,7 @@ public class Commandkill extends EssentialsCommand
final List<Player> matchedPlayers = server.matchPlayer(args[0]); final List<Player> matchedPlayers = server.matchPlayer(args[0]);
for (Player matchPlayer : matchedPlayers) for (Player matchPlayer : matchedPlayers)
{ {
if (ess.getUser(matchPlayer).isAuthorized("essentials.kill.exempt") && !ess.getUser(sender).isAuthorized("essentials.kill.force")) if (sender instanceof Player && ess.getUser(matchPlayer).isAuthorized("essentials.kill.exempt") && !ess.getUser(sender).isAuthorized("essentials.kill.force"))
{ {
throw new Exception(_("killExempt", matchPlayer.getDisplayName())); throw new Exception(_("killExempt", matchPlayer.getDisplayName()));
} }