From 9d3bddedb6bfc69ac2db9c0b743b2bdde93d1039 Mon Sep 17 00:00:00 2001 From: Harry Date: Sun, 5 May 2013 23:13:30 +0200 Subject: [PATCH] Return if command should not be executed to avoid exceptions and unnecessary messages to the player. --- proxy/src/main/java/net/md_5/bungee/command/CommandSend.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandSend.java b/proxy/src/main/java/net/md_5/bungee/command/CommandSend.java index 23182d69..6f308390 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandSend.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandSend.java @@ -27,6 +27,7 @@ public class CommandSend extends Command if ( target == null ) { sender.sendMessage( ChatColor.RED + "Target server does not exist" ); + return; } if ( args[0].equalsIgnoreCase( "all" ) ) @@ -40,6 +41,7 @@ public class CommandSend extends Command if ( !( sender instanceof ProxiedPlayer ) ) { sender.sendMessage( ChatColor.RED + "Only in game players can use this command" ); + return; } ProxiedPlayer player = (ProxiedPlayer) sender; for ( ProxiedPlayer p : player.getServer().getInfo().getPlayers() ) @@ -52,6 +54,7 @@ public class CommandSend extends Command if ( player == null ) { sender.sendMessage( ChatColor.RED + "That player is not online" ); + return; } summon( player, target, sender ); }