From 10a11665928cba125b5c49d94cee0aa543053f61 Mon Sep 17 00:00:00 2001 From: D3v1s0m <–49519439+D3v1s0m@users.noreply.github.com> Date: Thu, 11 May 2023 11:54:28 +0530 Subject: [PATCH] Fixed issue on empty properties --- .../java/lol/pyr/znpcsplus/storage/yaml/YamlStorage.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/storage/yaml/YamlStorage.java b/plugin/src/main/java/lol/pyr/znpcsplus/storage/yaml/YamlStorage.java index 3c33266..c73f480 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/storage/yaml/YamlStorage.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/storage/yaml/YamlStorage.java @@ -41,9 +41,11 @@ public class YamlStorage implements NpcStorage { deserializeLocation(config.getConfigurationSection("location"))); ConfigurationSection properties = config.getConfigurationSection("properties"); - for (String key : properties.getKeys(false)) { - EntityPropertyImpl property = EntityPropertyImpl.getByName(key); - npc.UNSAFE_setProperty(property, property.deserialize(properties.getString(key))); + if (properties != null) { + for (String key : properties.getKeys(false)) { + EntityPropertyImpl property = EntityPropertyImpl.getByName(key); + npc.UNSAFE_setProperty(property, property.deserialize(properties.getString(key))); + } } for (String line : config.getStringList("hologram")) {