Skip to content

Commit

Permalink
orEmpty
Browse files Browse the repository at this point in the history
Signed-off-by: J10a1n15 <[email protected]>
  • Loading branch information
j10a1n15 committed Oct 19, 2024
1 parent fca4165 commit 486a12f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ enum class MayorOverlay(private val configLine: String, private val createLines:
CANDIDATES(
"Candidates",
{
val candidates = MayorAPI.rawMayorData?.current?.candidates ?: emptyList()
val candidates = MayorAPI.rawMayorData?.current?.candidates.orEmpty()

Renderable.verticalContainer(
candidates.map { candidate ->
Expand Down Expand Up @@ -92,7 +92,7 @@ private fun renderPerson(title: String, name: String?, perks: List<Perk>?): Rend
val colorCode = MayorAPI.mayorNameToColorCode(name.orEmpty())
val perkLines = perks?.takeIf { config.showPerks }?.map { perk ->
"${if (perk.minister) "§6✯ " else ""}§e${perk.perkName}" to "§7${perk.description}"
} ?: emptyList()
}.orEmpty()

return Renderable.verticalContainer(
buildMap {
Expand Down

0 comments on commit 486a12f

Please sign in to comment.