diff --git a/src/main/java/com/massivecraft/massivecore/cmd/MassiveCommand.java b/src/main/java/com/massivecraft/massivecore/cmd/MassiveCommand.java index 5d2f4699..3dc9c8a1 100644 --- a/src/main/java/com/massivecraft/massivecore/cmd/MassiveCommand.java +++ b/src/main/java/com/massivecraft/massivecore/cmd/MassiveCommand.java @@ -247,24 +247,29 @@ public class MassiveCommand } } - // Set Sender Variables - this.sender = sender; - this.senderIsConsole = true; - this.me = null; - if (sender instanceof Player) + try { - this.me = (Player) sender; - this.senderIsConsole = false; + // Set Sender Variables + this.sender = sender; + this.senderIsConsole = true; + this.me = null; + if (sender instanceof Player) + { + this.me = (Player) sender; + this.senderIsConsole = false; + } + this.fixSenderVars(); + + if ( ! isValidCall(this.sender, this.getArgs())) return; + perform(); + } + finally + { + // Unset Sender Variables + this.sender = null; + this.me = null; + this.unsetSenderVars(); } - this.fixSenderVars(); - - if ( ! isValidCall(this.sender, this.getArgs())) return; - perform(); - - // Unset Sender Variables - this.sender = null; - this.me = null; - this.unsetSenderVars(); } public void fixSenderVars()