From ea88934e9ed9517068b614921d9aec1bdb8a6b0b Mon Sep 17 00:00:00 2001 From: John Doe Date: Sun, 7 Jun 2026 21:45:15 +0300 Subject: [PATCH] Safely handle JsonNull types --- .../java/com/eu/habbo/habbohotel/items/FurnidataReader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/FurnidataReader.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/FurnidataReader.java index 1af3dfc7..27cd61d1 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/FurnidataReader.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/FurnidataReader.java @@ -109,13 +109,13 @@ public class FurnidataReader { JsonArray types = sectionObj.getAsJsonArray("furnitype"); for (JsonElement el : types) { JsonObject o = el.getAsJsonObject(); - if (!o.has("id") || !o.has("classname")) continue; + if (!o.has("id") || o.get("id").isJsonNull() || !o.has("classname") || o.get("classname").isJsonNull()) continue; out.add(new FurnidataEntry( o.get("id").getAsInt(), o.get("classname").getAsString(), type, - o.has("name") ? o.get("name").getAsString() : "", - o.has("description") ? o.get("description").getAsString() : "" + (o.has("name") && !o.get("name").isJsonNull()) ? o.get("name").getAsString() : "", + (o.has("description") && !o.get("description").isJsonNull()) ? o.get("description").getAsString() : "" )); } }