fix: Prevent crash if a preview card does not have an author

This commit is contained in:
Nik Clayton 2023-12-09 22:38:19 +01:00
parent 4f65321a9d
commit 2a7eda667b
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -41,7 +41,7 @@ interface PreviewCard {
val title: String
val description: String
val kind: PreviewCardKind
val authorName: String
val authorName: String? // Not supposed to be null, per API, but seen null in the wild
val authorUrl: String
val providerName: String
val providerUrl: String