Skip to content

Fix crashes in the draft editors and the mobile variant list - #12552

Merged
kevlahnota merged 1 commit into
Card-Forge:masterfrom
MostCromulent:fix-format-pr-crashes
Nov 1, 2026
Merged

kevlahnota merged 1 commit into
Card-Forge:masterfrom
MostCromulent:fix-format-pr-crashes

Conversation

@MostCromulent

Copy link
Copy Markdown
Contributor

Summary

Fixes two crashes from #12521 (format dropdown) and #12522 (Canadian Highlander). The desktop one was reported. The mobile one was found by a code audit of both PRs and has not been reported.

Bug report

Desktop (reported): opening a booster draft throws.

java.lang.NullPointerException: Cannot invoke "...DeckController.getModel()" because the return value of "...ACEditorBase.getDeckController()" is null
    at forge.screens.deckeditor.controllers.CStatistics.analyze(CStatistics.java:125)
    at forge.screens.home.sanctioned.CSubmenuDraft.setupDraft(CSubmenuDraft.java:233)

Mobile (from code analysis): switching the lobby's Variants list from one variant to another can throw a ClassCastException.

Root cause

Fix

  • CStatistics hides the points line when the editor has no deck controller.
  • The Variants handler reads the chosen variant before clearing the old one.

Audit

Every file in both PRs was checked for other runtime errors, on desktop, mobile and Android (minSdk 26: d8 backports the new List.of, Map.copyOf and record uses). No other crash was found.


🤖 Generated with Claude Code

The deck statistics read the editor's deck to show format points, but
the draft, quest shop and token viewer editors have no deck, so every
pick or card move threw. The mobile lobby threw when switching from one
variant to another, because clearing the old variant reset the list to
(None) before the new choice was read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kevlahnota
kevlahnota merged commit 2292576 into Card-Forge:master Nov 1, 2026
4 checks passed
@MostCromulent
MostCromulent deleted the fix-format-pr-crashes branch November 1, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants