[Tusky10] fix crash when bookmarking a conversation while offline (#1686)

main
Konrad Pozniak 5 years ago committed by GitHub
parent 044235dc16
commit a0264b829c
  1. 3
      app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationsViewModel.kt

@ -74,6 +74,7 @@ class ConversationsViewModel @Inject constructor(
}
.subscribeOn(Schedulers.io())
.doOnError { t -> Log.w("ConversationViewModel", "Failed to bookmark conversation", t) }
.onErrorReturnItem(0)
.subscribe()
.autoDispose()
}
@ -127,7 +128,7 @@ class ConversationsViewModel @Inject constructor(
}
fun remove(position: Int) {
conversations.value?.getOrNull(position)?.let { conversation ->
conversations.value?.getOrNull(position)?.let {
refresh()
}
}

Loading…
Cancel
Save