Fix crash when trying to call conversation with empty recipient list

This commit is contained in:
Moez Bhatti
2018-08-13 07:10:25 +02:00
parent 6c4a7ecd96
commit 973db70b53
@@ -298,7 +298,7 @@ class ComposeViewModel @Inject constructor(
view.optionsItemIntent
.filter { it == R.id.call }
.withLatestFrom(conversation) { _, conversation -> conversation }
.mapNotNull { conversation -> conversation.recipients[0] }
.mapNotNull { conversation -> conversation.recipients.firstOrNull() }
.map { recipient -> recipient.address }
.autoDisposable(view.scope())
.subscribe { address -> navigator.makePhoneCall(address) }