mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Fixed NPE
This commit is contained in:
parent
c025349791
commit
d6506657d6
1 changed files with 15 additions and 3 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue