Fix crash when a player dies with a card on the stack

This commit is contained in:
Chris H
2024-11-01 12:39:25 -04:00
parent 7a91e18e2d
commit 473a65f9ba

View File

@@ -902,7 +902,9 @@ public class Game {
// return stolen spells // return stolen spells
if (c.isInZone(ZoneType.Stack)) { if (c.isInZone(ZoneType.Stack)) {
SpellAbilityStackInstance si = getStack().getInstanceMatchingSpellAbilityID(c.getCastSA()); SpellAbilityStackInstance si = getStack().getInstanceMatchingSpellAbilityID(c.getCastSA());
si.setActivatingPlayer(c.getController()); if (si != null) {
si.setActivatingPlayer(c.getController());
}
} }
if (c.getController().equals(p) && !(c.isPlane() || c.isPhenomenon())) { if (c.getController().equals(p) && !(c.isPlane() || c.isPhenomenon())) {
getAction().exile(c, null, null); getAction().exile(c, null, null);