fix: WOW crash on Receive -> Addresses (AccountPreviewHeader)

User report 05ebf86e: monero?.getCurrentAccount on a Wownero wallet. The
null-aware operator guards plugin presence, not wallet type, so the
Monero bridge always ran and CWMonero's cast threw before the ?? chain
could reach the wownero branch. Dispatch by wallet.type instead. Swept
lib for the same anti-pattern: account_customizer already dispatches
(fixed 2026-08-07) and the settings_store call sites take no wallet
argument; this was the last live instance.
This commit is contained in:
jwinterm
2026-08-18 08:28:25 -04:00
parent ca771f51d5
commit ae824d6455
+8 -3
View File
@@ -271,9 +271,14 @@ class AccountPreviewHeader extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
monero?.getCurrentAccount(dashboardViewModel.wallet).label ?? // Dispatch by wallet type: the null-aware operator only
wownero?.getCurrentAccount(dashboardViewModel.wallet).label ?? // guards plugin presence, so monero?. on a Wownero
"", // wallet still executes CWMonero's cast and throws.
dashboardViewModel.wallet.type == WalletType.monero
? monero?.getCurrentAccount(dashboardViewModel.wallet).label ?? ""
: dashboardViewModel.wallet.type == WalletType.wownero
? wownero?.getCurrentAccount(dashboardViewModel.wallet).label ?? ""
: "",
style: TextStyle(fontSize: 12, color: Theme.of(context).colorScheme.primary), style: TextStyle(fontSize: 12, color: Theme.of(context).colorScheme.primary),
), ),
Text( Text(