[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
1 changed files with 2 additions and 1 deletions

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