Fixed that replyTo and getRecipients() may return null
This commit is contained in:
parent
c1c33d80a0
commit
1d7c07e7d6
|
@ -160,8 +160,8 @@ open class EmailsFetcher(
|
||||||
|
|
||||||
val email = Email(
|
val email = Email(
|
||||||
sender, message.subject ?: "", map(message.sentDate ?: message.receivedDate),
|
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.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
|
(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),
|
status.folder.getUID(message),
|
||||||
parts.any { it.mediaType == "application/pgp-encrypted" },
|
parts.any { it.mediaType == "application/pgp-encrypted" },
|
||||||
imapMessage?.contentLanguage?.firstOrNull(),
|
imapMessage?.contentLanguage?.firstOrNull(),
|
||||||
|
|
Loading…
Reference in New Issue