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

This commit is contained in:
Konrad Pozniak 2020-02-14 19:03:42 +01:00 committed by GitHub
parent 28e128a4dd
commit 3a75ca25a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()
}
}