aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/jsonobjects/other/MayorJson.kt4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt
index 555fdb7f8..af60519f6 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt
@@ -218,7 +218,7 @@ object MayorAPI {
val currentMayorName = data.mayor.name
if (lastMayor?.name != currentMayorName) {
currentMayor = setAssumeMayorJson(currentMayorName, data.mayor.perks)
- currentMinister = setAssumeMayorJson(data.mayor.minister.name, listOf(data.mayor.minister.perk))
+ currentMinister = data.mayor.minister?.let { setAssumeMayorJson(it.name, listOf(it.perk)) }
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/other/MayorJson.kt b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/other/MayorJson.kt
index 912a6f8c6..272ed5591 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/other/MayorJson.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/other/MayorJson.kt
@@ -11,7 +11,9 @@ data class MayorInfo(
@Expose val key: String,
@Expose val name: String,
@Expose val perks: List<MayorPerk>,
- @Expose val minister: Minister,
+ // Ministers won't exist,
+ // when the current mayor is a special mayor
+ @Expose val minister: Minister?,
@Expose val election: MayorElection,
)