diff --git a/include/godot_cpp/core/engine_ptrcall.hpp b/include/godot_cpp/core/engine_ptrcall.hpp index 379d0026..7ed258e7 100644 --- a/include/godot_cpp/core/engine_ptrcall.hpp +++ b/include/godot_cpp/core/engine_ptrcall.hpp @@ -48,6 +48,9 @@ O *_call_native_mb_ret_obj(const GDNativeMethodBindPtr mb, void *instance, const GodotObject *ret = nullptr; std::array mb_args = { { (const GDNativeTypePtr)args... } }; internal::gdn_interface->object_method_bind_ptrcall(mb, instance, mb_args.data(), &ret); + if (ret == nullptr) { + return nullptr; + } return reinterpret_cast(internal::gdn_interface->object_get_instance_binding(ret, internal::token, &O::___binding_callbacks)); }