fix: Prevent crash if a preview card does not have an author
This commit is contained in:
parent
4f65321a9d
commit
2a7eda667b
|
@ -86,7 +86,7 @@ class PreviewCardView @JvmOverloads constructor(
|
||||||
|
|
||||||
when {
|
when {
|
||||||
card.description.isNotBlank() -> card.description
|
card.description.isNotBlank() -> card.description
|
||||||
card.authorName.isNotBlank() -> card.authorName
|
card.authorName.orEmpty().isNotBlank() -> card.authorName
|
||||||
else -> null
|
else -> null
|
||||||
}?.let { cardDescription.text = it } ?: cardDescription.hide()
|
}?.let { cardDescription.text = it } ?: cardDescription.hide()
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ interface PreviewCard {
|
||||||
val title: String
|
val title: String
|
||||||
val description: String
|
val description: String
|
||||||
val kind: PreviewCardKind
|
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 authorUrl: String
|
||||||
val providerName: String
|
val providerName: String
|
||||||
val providerUrl: String
|
val providerUrl: String
|
||||||
|
|
Loading…
Reference in New Issue