fix: users can exist without inviters

This commit is contained in:
Harsh Shandilya 2022-12-10 10:14:35 +00:00
parent 4b9b148519
commit 51a8538d6a
3 changed files with 10 additions and 4 deletions

View file

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Changed
- Fix crash when viewing [jcs](https://lobste.rs/u/jcs)' comments
## [1.12.0] - 2022-12-09 ## [1.12.0] - 2022-12-09
### Changed ### Changed

View file

@ -90,9 +90,11 @@ private fun UserProfileInternal(
ThemedRichText( ThemedRichText(
text = user.about, text = user.about,
) )
user.invitedBy?.let { invitedBy ->
ThemedRichText( ThemedRichText(
text = "Invited by [${user.invitedBy}](https://lobste.rs/u/${user.invitedBy})", text = "Invited by [${invitedBy}](https://lobste.rs/u/${user.invitedBy})",
) )
} }
} }
}
} }

View file

@ -15,7 +15,7 @@ import kotlinx.serialization.Serializable
class User( class User(
val username: String, val username: String,
val about: String, val about: String,
@SerialName("invited_by_user") val invitedBy: String, @SerialName("invited_by_user") val invitedBy: String?,
@SerialName("avatar_url") val avatarUrl: String, @SerialName("avatar_url") val avatarUrl: String,
@SerialName("created_at") val createdAt: String, @SerialName("created_at") val createdAt: String,
) )