change: Remove unnecessary null check

This commit is contained in:
Nik Clayton 2024-04-30 16:10:59 +02:00
parent d87a6718cc
commit b0fccb0aa7
2 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ class PreviewCardView @JvmOverloads constructor(
when {
card.description.isNotBlank() -> card.description
card.authorName.orEmpty().isNotBlank() -> card.authorName
card.authorName.isNotBlank() -> card.authorName
else -> null
}?.let { cardDescription.text = it } ?: cardDescription.hide()

View File

@ -41,7 +41,7 @@ class LoginWebViewViewModel @Inject constructor(
this.domain = domain
viewModelScope.launch {
api.getInstanceV1(domain).fold({ instance ->
instanceRules.value = instance.rules?.map { rule -> rule.text }.orEmpty()
instanceRules.value = instance.rules.map { rule -> rule.text }
}, { throwable ->
Timber.w(throwable, "failed to load instance info")
})