Fixed NPE in tooltips for Emblem choose-trigger

This commit is contained in:
magenoxx 2014-10-02 12:17:25 +04:00
parent 845d3a7951
commit 922e35ff1c
3 changed files with 11 additions and 14 deletions

View file

@ -1,24 +1,19 @@
package mage.client.util.gui;
import java.awt.*;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import mage.client.cards.Permanent;
import mage.constants.CardType;
import mage.constants.MageObjectType;
import mage.utils.CardUtil;
import mage.view.CardView;
import mage.view.CounterView;
import mage.view.PermanentView;
import org.jdesktop.swingx.JXPanel;
import org.mage.card.arcane.ManaSymbols;
import org.mage.card.arcane.UI;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
public class GuiDisplayUtil {
private static final Font cardNameFont = new Font("Calibri", Font.BOLD, 15);
private static final Insets DEFAULT_INSETS = new Insets(0, 0, 70, 25);
@ -228,8 +223,10 @@ public class GuiDisplayUtil {
buffer.append("[only controlled] ");
}
}
buffer.append(card.getMageObjectType().toString()).append("</td>");
buffer.append("</tr></table>");
if (!card.getMageObjectType().equals(MageObjectType.NULL)) {
buffer.append(card.getMageObjectType().toString());
}
buffer.append("</td></tr></table>");
StringBuilder rule = new StringBuilder("<br/>");
if (card.isSplitCard()) {

View file

@ -50,7 +50,6 @@ import mage.target.Targets;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.game.permanent.PermanentCard;
/**
* @author BetaSteward_at_googlemail.com
@ -73,7 +72,7 @@ public class CardView extends SimpleCardView {
protected int convertedManaCost;
protected Rarity rarity;
protected MageObjectType mageObjectType;
protected MageObjectType mageObjectType = MageObjectType.NULL;
protected boolean isAbility;
protected AbilityType abilityType;

View file

@ -32,7 +32,8 @@ public enum MageObjectType {
SPELL ("Spell", false, true),
PERMANENT ("Permanent", true, true),
EMBLEM ("Emblem", false, false),
COMMANDER ("Commander", false, false);
COMMANDER ("Commander", false, false),
NULL("NullObject", false, false);
private final String text;
private final boolean permanent;