mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
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:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user