Skip to content

Null safety crash: wallet screens accessible before balance sync completesΒ #553

@sallymoc

Description

@sallymoc

Description

Multiple wallet screens can crash or display incorrect balance information when accessed before the balance data has finished syncing, since assets and balance load independently.

Affected Screens

  • TransferAsset - uses item.amount! without null check
  • ReleaseTransferRights - uses item.amount! without null check
  • Send - already handles this 'correctly' by waiting for item.amount != null

Current Issue

In lib/pages/main/wallet_contents/release_transfer_rights.dart:

  • Line 415 and 421: widget.item.amount! can crash if balance hasn't synced
  • Line 399 (getFeeInfo()): Uses widget.item.amount! in validation without null check
  • Line 637 (releaseTransferRightsHandler()): No validation to check if balance is loaded before submission

Possible Solutions

Approach 1

Prevent users from accessing TransferAsset and ReleaseTransferRights screens until balance data is available:

  • Hide or disable entry buttons for these screens until amount != null
  • This matches the existing behavior in the Send screen
  • Prevents showing incorrect "0" balance temporarily
  • Ensures screens only open when required data is ready

Approach 2

To listen to the changes in the balance and refresh the form to reflect it.
To display the balance is currently not available and a warning the transaction might fail and/or disable the send button until the balance is not null

Related

Detected during review of PR #548
Original discussion: #548

Metadata

Metadata

Labels

BugSomething isn't working

Type

Projects

Status

πŸ“‹ Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions