forked from External/mage
Fixed NPE errors
This commit is contained in:
parent
ca0297d7c8
commit
be6a588a7f
19 changed files with 37 additions and 23 deletions
|
|
@ -9,6 +9,7 @@ import mage.constants.Outcome;
|
|||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -53,7 +54,7 @@ public class PlayTheTopCardEffect extends AsThoughEffectImpl {
|
|||
@Override
|
||||
public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game, UUID playerId) {
|
||||
Card cardToCheck = game.getCard(objectId);
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
objectId = CardUtil.getMainCardId(game, objectId); // for split cards
|
||||
|
||||
if (cardToCheck != null
|
||||
&& playerId.equals(source.getControllerId())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue