- NPE guard.

This commit is contained in:
Agetian
2015-06-02 05:12:22 +00:00
parent 6bc4848857
commit 10e991510d

View File

@@ -524,8 +524,11 @@ public class CardDetailUtil {
if (!card.getName().isEmpty()) {
origPaperCard = FModel.getMagicDb().getCommonCards().getCard(card.getName());
} else {
// probably a morph, try to get its identity from the alternate state
origPaperCard = FModel.getMagicDb().getCommonCards().getCard(card.getAlternateState().getName());
// probably a morph or manifest, try to get its identity from the alternate state
String altName = card.getAlternateState().getName();
if (!altName.isEmpty()) {
origPaperCard = FModel.getMagicDb().getCommonCards().getCard(card.getAlternateState().getName());
}
}
if (origPaperCard != null) {
origCard = Card.getCardForUi(origPaperCard); // if null, probably a variant card