Skip to content

Commit c25d689

Browse files
Allow pass nullptr Object * from godot core
1 parent feaba55 commit c25d689

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/godot_cpp/core/method_ptrcall.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ MAKE_PTRARG_BY_REFERENCE(Variant);
168168
template <class T>
169169
struct PtrToArg<T *> {
170170
_FORCE_INLINE_ static T *convert(const void *p_ptr) {
171+
if (*((T **)p_ptr) == nullptr) {
172+
return nullptr;
173+
}
171174
return reinterpret_cast<T *>(godot::internal::gde_interface->object_get_instance_binding(
172175
reinterpret_cast<GDExtensionObjectPtr>(const_cast<void *>(p_ptr)),
173176
godot::internal::token, &T::___binding_callbacks));

0 commit comments

Comments
 (0)