summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRameshRavone <ramesh.maran443@gmail.com>2019-05-18 07:54:16 +0530
committerRameshRavone <ramesh.maran443@gmail.com>2019-05-18 07:55:48 +0530
commit71808b38bc787cb2c903f3ac0479a0bc6e905fa8 (patch)
tree52771dd0d4ac47d2915f7531950e39bd19ee9a8f
parent40a5f81ae540cd7923cd438ccb21ffb41cfbc87d (diff)
NULL global_tag for non exposed classes
-rw-r--r--modules/gdnative/nativescript/nativescript.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp
index 04ba28dc68..c2aa8427b4 100644
--- a/modules/gdnative/nativescript/nativescript.cpp
+++ b/modules/gdnative/nativescript/nativescript.cpp
@@ -1345,7 +1345,7 @@ void *NativeScriptLanguage::get_instance_binding_data(int p_idx, Object *p_objec
if (!(*binding_data)[p_idx]) {
- const void *global_type_tag = global_type_tags[p_idx].get(p_object->get_class_name());
+ const void *global_type_tag = get_global_type_tag(p_idx, p_object->get_class_name());
// no binding data yet, soooooo alloc new one \o/
(*binding_data).write[p_idx] = binding_functions[p_idx].second.alloc_instance_binding_data(binding_functions[p_idx].second.data, global_type_tag, (godot_object *)p_object);
@@ -1454,6 +1454,9 @@ const void *NativeScriptLanguage::get_global_type_tag(int p_idx, StringName p_cl
const HashMap<StringName, const void *> &tags = global_type_tags[p_idx];
+ if (!tags.has(p_class_name))
+ return NULL;
+
const void *tag = tags.get(p_class_name);
return tag;