Fixed NPE

This commit is contained in:
Oleg Agafonov 2023-04-15 14:13:51 +04:00
parent c025349791
commit d6506657d6

View file

@ -219,10 +219,22 @@ public class TargetPermanentOrPlayer extends TargetImpl {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null) {
sb.append(permanent.getLogName()).append(' ');
} else {
Player player = game.getPlayer(targetId);
sb.append(player.getLogName()).append(' ');
continue;
}
Player player = game.getPlayer(targetId);
if (player != null) {
sb.append(player.getLogName()).append(' ');
continue;
}
MageObject object = game.getObject(targetId);
if (object != null) {
sb.append(object.getLogName()).append(' ');
continue;
}
sb.append("ERROR");
}
return sb.toString().trim();
}