fix crash when trying to view account with invalid id

closes #848
main
Conny Duck 6 years ago
parent cc774ab754
commit ef9ac3939e
  1. 2
      app/src/main/java/com/keylesspalace/tusky/viewmodel/AccountViewModel.kt

@ -69,7 +69,7 @@ class AccountViewModel @Inject constructor(
override fun onResponse(call: Call<List<Relationship>>,
response: Response<List<Relationship>>) {
val relationships = response.body()
if (response.isSuccessful && relationships != null) {
if (response.isSuccessful && relationships != null && relationships.getOrNull(0) != null) {
val relationship = relationships[0]
relationshipData.postValue(Success(relationship))
} else {

Loading…
Cancel
Save