Skip to content

Fix card loading crash#10368

Merged
Agetian merged 2 commits intoCard-Forge:masterfrom
autumnmyst:fix-card-loading
Apr 12, 2026
Merged

Fix card loading crash#10368
Agetian merged 2 commits intoCard-Forge:masterfrom
autumnmyst:fix-card-loading

Conversation

@autumnmyst
Copy link
Copy Markdown
Contributor

#10288 added a post-loop supplyPlaceholderFaces step for CopyFaceFrom cards, but two gaps cause StaticData init to NPE leaving commonCards null and breaking desktop tests whenever a placeholder card lands in a funny/silver-bordered set.

  1. CardRules.getType() is not pre-init safe. While getPreInitName()/isVariant() both tolerate a null mainPart, getType() results in StaticData.'s card.getType().isBasicLand() to NPE. Fixed by returning an empty CardType when mainPart is null, and falling back to mainPart.getType() if otherPart is null in COMBINE mode.
  2. CardDb constructor skips placeholder for filtered cards. The filteredCards continue jumps over needsPlaceholderFaces.add(rule), so filtered placeholder cards never get their faces supplied but they're still in rulesByName, and initialize -> addSetCard -> cr.getName() later crashes. Fix: collect placeholder rules before the filter check.

@autumnmyst autumnmyst changed the title [bug] Fix card loading crash Fix card loading crash Apr 12, 2026
@tool4ever tool4ever requested a review from Jetz72 April 12, 2026 07:09
@Hanmac Hanmac requested a review from tool4ever April 12, 2026 07:39
@Agetian Agetian merged commit be30038 into Card-Forge:master Apr 12, 2026
2 checks passed
@tool4ever
Copy link
Copy Markdown
Contributor

good catch before this landed in snapshot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants