File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
include/godot_cpp/classes Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,9 @@ template <typename T>
230
230
struct PtrToArg <Ref<T>> {
231
231
_FORCE_INLINE_ static Ref<T> convert (const void *p_ptr) {
232
232
GDExtensionRefPtr ref = (GDExtensionRefPtr)p_ptr;
233
- ERR_FAIL_NULL_V (p_ptr, Ref<T>());
233
+ if (unlikely (!p_ptr)) {
234
+ return Ref<T>();
235
+ }
234
236
return Ref<T>(reinterpret_cast <T *>(godot::internal::get_object_instance_binding (godot::internal::gdextension_interface_ref_get_object (ref))));
235
237
}
236
238
@@ -254,7 +256,9 @@ struct PtrToArg<const Ref<T> &> {
254
256
255
257
_FORCE_INLINE_ static Ref<T> convert (const void *p_ptr) {
256
258
GDExtensionRefPtr ref = const_cast <GDExtensionRefPtr>(p_ptr);
257
- ERR_FAIL_NULL_V (p_ptr, Ref<T>());
259
+ if (unlikely (!p_ptr)) {
260
+ return Ref<T>();
261
+ }
258
262
return Ref<T>(reinterpret_cast <T *>(godot::internal::get_object_instance_binding (godot::internal::gdextension_interface_ref_get_object (ref))));
259
263
}
260
264
};
You can’t perform that action at this time.
0 commit comments