Fixed that replyTo and getRecipients() may return null

This commit is contained in:
dankito 2024-11-27 04:36:36 +01:00
parent c1c33d80a0
commit 1d7c07e7d6
1 changed files with 2 additions and 2 deletions

View File

@ -160,8 +160,8 @@ open class EmailsFetcher(
val email = Email(
sender, message.subject ?: "", map(message.sentDate ?: message.receivedDate),
message.getRecipients(Message.RecipientType.TO).map { map(it) }, message.getRecipients(Message.RecipientType.CC).map { map(it) },
(message.replyTo.firstOrNull() as? InternetAddress)?.let { if (it.address != sender?.address) map(it) else null }, // only set replyTo if it differs from sender
message.getRecipients(Message.RecipientType.TO).orEmpty().map { map(it) }, message.getRecipients(Message.RecipientType.CC).orEmpty().map { map(it) },
(message.replyTo?.firstOrNull() as? InternetAddress)?.let { if (it.address != sender?.address) map(it) else null }, // only set replyTo if it differs from sender
status.folder.getUID(message),
parts.any { it.mediaType == "application/pgp-encrypted" },
imapMessage?.contentLanguage?.firstOrNull(),