Preventing crash when function returned null ptr
parent
6d48282187
commit
7c5a1eab11
|
@ -633,7 +633,11 @@ def generate_icall_implementation(icalls):
|
||||||
|
|
||||||
if ret_type != "void":
|
if ret_type != "void":
|
||||||
if is_class_type(ret_type):
|
if is_class_type(ret_type):
|
||||||
source.append("\treturn (Object *) godot::nativescript_1_1_api->godot_nativescript_get_instance_binding_data(godot::_RegisterState::language_index, ret);")
|
source.append("\tif (ret) {")
|
||||||
|
source.append("\t\treturn (Object *) godot::nativescript_1_1_api->godot_nativescript_get_instance_binding_data(godot::_RegisterState::language_index, ret);")
|
||||||
|
source.append("\t}")
|
||||||
|
source.append("")
|
||||||
|
source.append("\treturn (Object *) ret;")
|
||||||
else:
|
else:
|
||||||
source.append("\treturn ret;")
|
source.append("\treturn ret;")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue