What changed, and why it matters
This is a small UI stability fix in a Dart/Flutter transaction list screen. It checks whether the widget is still on screen before calling setState after an asynchronous data update, preventing a common Flutter runtime error when a user navigates away before the update arrives. There is no indication this affects funds, keys, network traffic, or app permissions.
No security action required; treat as a routine UI robustness fix.
Security signals we found
UI lifecycle race condition fixed
No cryptographic, authentication, or network changes
No input validation or parsing changes
Evidence from the diff
The patch wraps setState() inside a mounted check in a stream listener callback for a transaction list. In Flutter, calling setState on a disposed widget throws a ‘setState() called after dispose()’ assertion/error. The fix prevents that lifecycle race by guarding setState with if (mounted). It does not change data handling, validation, cryptography, or navigation logic.
Changed components
lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_list.dartInspect captured patch +5 / −3
diff --git a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_list.dart b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_list.dart
index fc4269f..74e83cf 100644
--- a/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_list.dart
+++ b/lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_list.dart
@@ -131,9 +131,11 @@ class _TransactionsV2ListState extends ConsumerState<TransactionsV2List> {
_subscription = _query.watch().listen((event) {
WidgetsBinding.instance.addPostFrameCallback((_) {
- setState(() {
- _transactions = event;
- });
+ if (mounted) {
+ setState(() {
+ _transactions = event;
+ });
+ }
});
});
Why this scored 16/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.