mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
null check on player debug command
This commit is contained in:
parent
db70d56493
commit
27b1c6b094
@ -22,6 +22,10 @@ public class PlayerDebugCommand extends BaseCommand {
|
|||||||
public void onCommand(CommandSender sender) {
|
public void onCommand(CommandSender sender) {
|
||||||
if(sender instanceof Player) {
|
if(sender instanceof Player) {
|
||||||
McMMOPlayer mcMMOPlayer = plugin.getUserManager().getPlayer((Player) sender);
|
McMMOPlayer mcMMOPlayer = plugin.getUserManager().getPlayer((Player) sender);
|
||||||
|
|
||||||
|
if(mcMMOPlayer == null)
|
||||||
|
return;
|
||||||
|
|
||||||
mcMMOPlayer.toggleDebugMode(); //Toggle debug mode
|
mcMMOPlayer.toggleDebugMode(); //Toggle debug mode
|
||||||
plugin.getNotificationManager().sendPlayerInformationChatOnlyPrefixed(mcMMOPlayer.getPlayer(), "Commands.Mmodebug.Toggle", String.valueOf(mcMMOPlayer.isDebugMode()));
|
plugin.getNotificationManager().sendPlayerInformationChatOnlyPrefixed(mcMMOPlayer.getPlayer(), "Commands.Mmodebug.Toggle", String.valueOf(mcMMOPlayer.isDebugMode()));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user