Fix potential NPE.

This commit is contained in:
Jetz
2024-06-07 22:58:09 -04:00
parent 49e7576742
commit a3662079b4

View File

@@ -3484,7 +3484,11 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
public final void setCopiedPermanent(final Card c) { public final void setCopiedPermanent(final Card c) {
if (copiedPermanent == c) { return; } if (copiedPermanent == c) { return; }
copiedPermanent = c; copiedPermanent = c;
currentState.setOracleText(c.getOracleText()); if(c != null)
currentState.setOracleText(c.getOracleText());
//Could fetch the card rules oracle text in an "else" clause here,
//but CardRules isn't aware of the card's state. May be better to
//just stash the original oracle text if this comes up.
} }
public final boolean isCopiedSpell() { public final boolean isCopiedSpell() {