Merge pull request #3513 from Lakoja/fix-relationship-crash
Do not crash on empty relationship response
This commit is contained in:
commit
73be497bbe
1 changed files with 1 additions and 1 deletions
|
@ -85,7 +85,7 @@ class AccountViewModel @Inject constructor(
|
|||
mastodonApi.relationships(listOf(accountId))
|
||||
.fold(
|
||||
{ relationships ->
|
||||
relationshipData.postValue(Success(relationships[0]))
|
||||
relationshipData.postValue(if (relationships.isNotEmpty()) Success(relationships[0]) else Error())
|
||||
},
|
||||
{ t ->
|
||||
Log.w(TAG, "failed obtaining relationships", t)
|
||||
|
|
Loading…
Reference in a new issue