aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt
index e79e60dfb..af1be6bc4 100644
--- a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt
@@ -17,7 +17,9 @@ class CollectionAPI {
@SubscribeEvent
fun onProfileDataLoad(event: ProfileApiDataLoadedEvent) {
val profileData = event.profileData
- for ((rawName, rawCounter) in profileData["collection"].asJsonObject.entrySet()) {
+ val jsonElement = profileData["collection"]?: return
+ val asJsonObject = jsonElement.asJsonObject ?: return
+ for ((rawName, rawCounter) in asJsonObject.entrySet()) {
val counter = rawCounter.asLong
var itemName = BazaarApi.getBazaarDataForInternalName(rawName)?.itemName
if (rawName == "MUSHROOM_COLLECTION") {