diff --git a/include/godot_cpp/core/method_ptrcall.hpp b/include/godot_cpp/core/method_ptrcall.hpp index 6a5227a26..c94687874 100644 --- a/include/godot_cpp/core/method_ptrcall.hpp +++ b/include/godot_cpp/core/method_ptrcall.hpp @@ -168,6 +168,9 @@ MAKE_PTRARG_BY_REFERENCE(Variant); template struct PtrToArg { _FORCE_INLINE_ static T *convert(const void *p_ptr) { + if (*((T **)p_ptr) == nullptr) { + return nullptr; + } return reinterpret_cast(godot::internal::gde_interface->object_get_instance_binding( reinterpret_cast(const_cast(p_ptr)), godot::internal::token, &T::___binding_callbacks));