1
0
mirror of https://github.com/accelforce/Yuito synced 2025-02-07 15:18:47 +01:00

Do not crash on empty relationship response

This commit is contained in:
Lakoja 2023-04-05 10:54:03 +02:00
parent cf50d0563f
commit eb52c8ca58

View File

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