From a25c96eda7e33c9d331d2e16c6be1481ac3d5b02 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Mon, 13 Apr 2015 11:51:04 +0100 Subject: [PATCH] SPIGOT-742: Throw an exception instead of passing null when the sender cannot be converted --- .../org/bukkit/craftbukkit/command/VanillaCommandWrapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java index e709825563..96a0ae1fe7 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java @@ -161,7 +161,7 @@ public final class VanillaCommandWrapper extends VanillaCommand { if (sender instanceof ProxiedCommandSender) { return ((ProxiedNativeCommandSender) sender).getHandle(); } - return null; + throw new IllegalArgumentException("Cannot make " + sender + " a vanilla command listener"); } private int getPlayerListSize(String as[]) {