mirror of
https://github.com/correl/mage.git
synced 2024-11-29 03:00:12 +00: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);
|
Permanent permanent = game.getPermanent(targetId);
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
sb.append(permanent.getLogName()).append(' ');
|
sb.append(permanent.getLogName()).append(' ');
|
||||||
} else {
|
continue;
|
||||||
Player player = game.getPlayer(targetId);
|
|
||||||
sb.append(player.getLogName()).append(' ');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
return sb.toString().trim();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue