From 8dc70a4e98739e1650811bb0aaac31763c2f9759 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Wed, 23 Jan 2013 05:51:46 -0600 Subject: [PATCH] Don't try listing something that may not exist. Fixes BUKKIT-3471 The player name may not be provided, in which case the command will fail hard. By: feildmaster --- .../src/main/java/org/bukkit/command/defaults/ClearCommand.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/ClearCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/ClearCommand.java index 02d1e505ba..a9df4f903c 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/ClearCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/ClearCommand.java @@ -62,6 +62,8 @@ public class ClearCommand extends VanillaCommand { int count = player.getInventory().clear(id, data); Command.broadcastCommandMessage(sender, "Cleared the inventory of " + player.getDisplayName() + ", removing " + count + " items"); + } else if (args.length == 0) { + sender.sendMessage(ChatColor.RED + "Please provide a player!"); } else { sender.sendMessage(ChatColor.RED + "Can't find player " + args[0]); }