From 5621e5d2d44cfffcb474ffa8d55a6eff69e7a48b Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Sat, 15 Sep 2018 21:51:53 +0200 Subject: [PATCH] fix crash when trying to view account with invalid id closes #848 --- .../java/com/keylesspalace/tusky/viewmodel/AccountViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/viewmodel/AccountViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/viewmodel/AccountViewModel.kt index 7fd9b976..efeb0316 100644 --- a/app/src/main/java/com/keylesspalace/tusky/viewmodel/AccountViewModel.kt +++ b/app/src/main/java/com/keylesspalace/tusky/viewmodel/AccountViewModel.kt @@ -69,7 +69,7 @@ class AccountViewModel @Inject constructor( override fun onResponse(call: Call>, response: Response>) { 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 {