Fix crash when advanced search with only select attachment

This commit is contained in:
dab246
2023-02-17 16:19:34 +07:00
committed by Dat Vu
parent 062f444b86
commit f614a2bab4
+14 -2
View File
@@ -55,7 +55,13 @@ class PresentationEmail with EquatableMixin {
}
);
String getSenderName() => from?.first.asString() ?? '';
String getSenderName() {
if (from?.isNotEmpty == true) {
return from?.first.asString() ?? '';
} else {
return '';
}
}
String getAvatarText() {
if (getSenderName().isNotEmpty) {
@@ -76,7 +82,13 @@ class PresentationEmail with EquatableMixin {
bool get withAttachments => hasAttachment == true;
String get mailboxName => mailboxNames?.first?.name ?? '';
String get mailboxName {
if (mailboxNames?.isNotEmpty == true) {
return mailboxNames?.first?.name ?? '';
} else {
return '';
}
}
String get routeWebAsString => routeWeb.toString();