From 6fcc792b980c95f17275ca2fbab303aa8c162d88 Mon Sep 17 00:00:00 2001 From: Cedric Hippmann Date: Sun, 1 Sep 2024 10:14:25 +0200 Subject: [PATCH] Always return a Variant (even Nil) for exported properties. (#675) --- src/script/jvm_script.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/script/jvm_script.cpp b/src/script/jvm_script.cpp index ba18b21ebb..b1ed4f76b8 100644 --- a/src/script/jvm_script.cpp +++ b/src/script/jvm_script.cpp @@ -231,10 +231,12 @@ void JvmScript::update_script() { get_script_exported_property_list(&exported_properties); for (auto& exported_property : exported_properties) { - if(exported_property.type == Variant::OBJECT) { continue;} Variant default_value; const String& property_name {exported_property.name}; - kotlin_script_instance->get_or_default(property_name, default_value); + + if(exported_property.type != Variant::OBJECT) { + kotlin_script_instance->get_or_default(property_name, default_value); + } exported_members_default_value_cache[property_name] = default_value; }