diff --git a/src/main/java/com/songoda/ultimatemoderation/command/commands/CommandSpy.java b/src/main/java/com/songoda/ultimatemoderation/command/commands/CommandSpy.java index f56fa08..acf24d0 100644 --- a/src/main/java/com/songoda/ultimatemoderation/command/commands/CommandSpy.java +++ b/src/main/java/com/songoda/ultimatemoderation/command/commands/CommandSpy.java @@ -32,7 +32,7 @@ public class CommandSpy extends AbstractCommand { senderP.sendMessage(instance.getReferences().getPrefix() + instance.getLocale().getMessage("command.spy.cant")); return; } - + boolean didVanish = false; if (!CommandVanish.isVanished(senderP)) { didVanish = true; @@ -65,6 +65,13 @@ public class CommandSpy extends AbstractCommand { return ReturnType.SUCCESS; } + Player player = Bukkit.getPlayer(args[0]); + + if (player == null) { + sender.sendMessage(instance.getReferences().getPrefix() + "That player does not exist or is not online."); + return ReturnType.FAILURE; + } + spy(player, senderP); return ReturnType.SUCCESS;