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>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
968db75c69
commit
dee3c32a5c
@@ -156,6 +156,7 @@ class EmailRepositoryImpl implements EmailRepository {
|
||||
return;
|
||||
}
|
||||
|
||||
if (threadEmails.isEmpty) return;
|
||||
final latest = threadEmails.last;
|
||||
|
||||
// Collect unique participants across the whole thread.
|
||||
|
||||
Reference in New Issue
Block a user