Fix crash when starting new conversation

Fixes #1555
This commit is contained in:
Moez Bhatti
2020-01-13 18:53:57 -05:00
parent 5147805519
commit 6ea4eb9e80
@@ -248,7 +248,7 @@ class ComposeViewModel @Inject constructor(
conversationRepo.getRecipients()
.asSequence()
.filter { recipient -> recipient.contact?.lookupKey == lookupKey }
.first { recipient -> phoneNumberUtils.compare(recipient.address, address) }
.firstOrNull { recipient -> phoneNumberUtils.compare(recipient.address, address) }
?: Recipient(
address = address,
contact = lookupKey?.let(contactRepo::getUnmanagedContact))