Skip to content

Commit

Permalink
Fix crash when trying to call conversation with empty recipient list
Browse files Browse the repository at this point in the history
  • Loading branch information
moezbhatti committed Aug 13, 2018
1 parent 6c4a7ec commit 973db70
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down

0 comments on commit 973db70

Please sign in to comment.