null check on player debug command

This commit is contained in:
nossr50 2020-02-24 17:08:23 -08:00
parent db70d56493
commit 27b1c6b094

View File

@ -22,6 +22,10 @@ public class PlayerDebugCommand extends BaseCommand {
public void onCommand(CommandSender sender) {
if(sender instanceof Player) {
McMMOPlayer mcMMOPlayer = plugin.getUserManager().getPlayer((Player) sender);
if(mcMMOPlayer == null)
return;
mcMMOPlayer.toggleDebugMode(); //Toggle debug mode
plugin.getNotificationManager().sendPlayerInformationChatOnlyPrefixed(mcMMOPlayer.getPlayer(), "Commands.Mmodebug.Toggle", String.valueOf(mcMMOPlayer.isDebugMode()));
} else {