Compare commits

..
Author SHA1 Message Date
Thomas SharedInboxandClaude Sonnet 4.6 dee3c32a5c fix: guard threadEmails.last against empty list
Add an isEmpty check before accessing threadEmails.last to prevent
StateError when emails are deleted between query and access.

Closes #341

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 17:49:54 +02:00
2 changed files with 2 additions and 1 deletions
@@ -156,6 +156,7 @@ class EmailRepositoryImpl implements EmailRepository {
return;
}
if (threadEmails.isEmpty) return;
final latest = threadEmails.last;
// Collect unique participants across the whole thread.
+1 -1
View File
@@ -33,7 +33,7 @@ dependencies:
flutter_secure_storage: ^10.0.0
# Date formatting
intl: ^0.20.2
intl: any
# File picking (compose attachments) and opening downloaded attachments
file_picker: ^12.0.0-beta.4