fix send to spark name gray screen (nav error)
What changed, and why it matters
This commit fixes a UI crash (gray screen) that occurred when confirming a transaction sent to a Spark name. The crash happened because the code tried to read the first recipient address from an empty list. The fix safely checks whether a recipient exists before reading its address, falling back to Spark-specific recipient data when needed. There is no indication this is a security vulnerability; it is a robustness fix for a user-facing navigation/display error.
Treat as a routine bug-fix / UX hardening patch. No security response required. If desired, verify the Spark send flow no longer produces a gray screen when recipients is empty, and ensure the fallback to sparkRecipients behaves correctly.
Security signals we found
Null-safety / empty-list crash hardening in UI rendering
No change to authentication, transaction signing, validation, or network logic
No external references or vendor security disclosure provided
Evidence from the diff
In confirm_transaction_view.dart, two ternary expressions previously used .first.address on widget.txData.recipients, which throws when the list is null or empty. The patch replaces .first with .firstOrNull and adds an additional null-aware access (?.address), preventing a StateError/NoSuchMethodError and the resulting gray screen. The fallback path to widget.txData.sparkRecipients!.first.address remains unchanged. No security boundary, cryptographic operation, or input validation logic is modified.
Changed components
lib/pages/send_view/confirm_transaction_view.dartSpark name send confirmation UI flowInspect captured patch +10 / −2
diff --git a/lib/pages/send_view/confirm_transaction_view.dart b/lib/pages/send_view/confirm_transaction_view.dart
index b54b3b0..ed4e967 100644
--- a/lib/pages/send_view/confirm_transaction_view.dart
+++ b/lib/pages/send_view/confirm_transaction_view.dart
@@ -764,7 +764,11 @@ class _ConfirmTransactionViewState
Text(
widget.isPaynymTransaction
? widget.txData.paynymAccountLite!.nymName
- : widget.txData.recipients?.first.address ??
+ : widget
+ .txData
+ .recipients
+ ?.firstOrNull
+ ?.address ??
widget
.txData
.sparkRecipients!
@@ -1110,7 +1114,11 @@ class _ConfirmTransactionViewState
// TODO: [prio=med] spark transaction specifics - better handling
widget.isPaynymTransaction
? widget.txData.paynymAccountLite!.nymName
- : widget.txData.recipients?.first.address ??
+ : widget
+ .txData
+ .recipients
+ ?.firstOrNull
+ ?.address ??
widget
.txData
.sparkRecipients!
Why this scored 20/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.