Fix error when trying to call conversation with no recipients

This commit is contained in:
Moez Bhatti
2018-07-15 16:11:50 -04:00
parent 2d51794be8
commit 9077a92053
@@ -298,7 +298,7 @@ class ComposeViewModel @Inject constructor(
view.optionsItemIntent
.filter { it == R.id.call }
.withLatestFrom(conversation) { _, conversation -> conversation }
.map { conversation -> conversation.recipients.first() }
.mapNotNull { conversation -> conversation.recipients[0] }
.map { recipient -> recipient.address }
.autoDisposable(view.scope())
.subscribe { address -> navigator.makePhoneCall(address) }