mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-12-01 06:53:26 +01:00
Fix LivesCommand NPE
This commit is contained in:
parent
5c7b466623
commit
d900c80cf7
@ -62,6 +62,10 @@ public class LivesCommand extends BRCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DGamePlayer dPlayer = DGamePlayer.getByPlayer(player);
|
DGamePlayer dPlayer = DGamePlayer.getByPlayer(player);
|
||||||
|
if (dPlayer == null && args.length == 1) {
|
||||||
|
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_PLAYER.getMessage(args[1]));
|
||||||
|
return;
|
||||||
|
}
|
||||||
DGroup dGroup = dPlayer != null ? dPlayer.getDGroup() : DGroup.getByName(args[1]);
|
DGroup dGroup = dPlayer != null ? dPlayer.getDGroup() : DGroup.getByName(args[1]);
|
||||||
if (dPlayer != null) {
|
if (dPlayer != null) {
|
||||||
MessageUtil.sendMessage(sender, DMessages.CMD_LIVES_PLAYER.getMessage(dPlayer.getName(), String.valueOf(dPlayer.getLives() == -1 ? "UNLIMITED" : dPlayer.getLives())));
|
MessageUtil.sendMessage(sender, DMessages.CMD_LIVES_PLAYER.getMessage(dPlayer.getName(), String.valueOf(dPlayer.getLives() == -1 ? "UNLIMITED" : dPlayer.getLives())));
|
||||||
|
Loading…
Reference in New Issue
Block a user