diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-01 18:10:26 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-01 18:10:26 +0100 |
commit | 96796c151896929f01a831bbf2ab64ab18004bcd (patch) | |
tree | 1dabfa21ef03dd2c441318817c68d82b9647fb59 /core/extension | |
parent | fc2241d5d89802d2a31040e0fae3bc0f68f1de33 (diff) | |
parent | a2e6e996b28fe771c2594010fb3db098f918f49a (diff) |
Merge pull request #64427 from touilleMan/gdextension-skip-undefined-field-in-properties
[GDExtension] Skip unset getter/setter/index fields in class property
Diffstat (limited to 'core/extension')
-rw-r--r-- | core/extension/extension_api_dump.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp index 22787a9847..196bb68b2b 100644 --- a/core/extension/extension_api_dump.cpp +++ b/core/extension/extension_api_dump.cpp @@ -871,9 +871,18 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() { Dictionary d2; d2["type"] = get_property_info_type_name(F); d2["name"] = String(property_name); - d2["setter"] = ClassDB::get_property_setter(class_name, F.name); - d2["getter"] = ClassDB::get_property_getter(class_name, F.name); - d2["index"] = ClassDB::get_property_index(class_name, F.name); + StringName setter = ClassDB::get_property_setter(class_name, F.name); + if (!(setter == "")) { + d2["setter"] = setter; + } + StringName getter = ClassDB::get_property_getter(class_name, F.name); + if (!(getter == "")) { + d2["getter"] = getter; + } + int index = ClassDB::get_property_index(class_name, F.name); + if (index != -1) { + d2["index"] = index; + } properties.push_back(d2); } |