Commit a51e07e
Fix NPE when cloning Adventure creatures on mobile (#10349)
When a clone (e.g. Superior Spider-Man) copies an Adventure creature,
the CardView's AlternateState was null because getAlternateState() only
checks original card states, not clone states. The mobile renderer then
crashes calling getName() on the null state when rendering with card
images disabled.
Two fixes: CardView.updateState() falls back to the Secondary clone
state, and CardImageRenderer falls back from the backup to the in-game
card when the backup lacks the adventure state.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Hans Mackowiak <hanmac@gmx.de>1 parent 04a9a9a commit a51e07e
2 files changed
Lines changed: 10 additions & 0 deletions
File tree
- forge-game/src/main/java/forge/game/card
- forge-gui-mobile/src/forge/card
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1144 | 1144 | | |
1145 | 1145 | | |
1146 | 1146 | | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
1147 | 1153 | | |
1148 | 1154 | | |
1149 | 1155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
659 | 663 | | |
660 | 664 | | |
661 | 665 | | |
| |||
0 commit comments