Passing null
for RefCounted
argument from GDScript prints error (though the function runs without problems)
#1615
Labels
bug
This has been identified as a bug
Godot version
v4.4.dev3.official (f4af820)
godot-cpp version
4.4.dev (6facde3)
System information
Ubuntu 22.04.5 LTS 22.04 - X11 - Vulkan (Forward+)
Issue description
A GDExtension function with a
RefCounted
parameter (usingRef
), which may benull
, works fine from within GDExtension, but sometimes prints an error when passingnull
from GDScript.The functionality remains in all cases, except for the printed error in one corner-case.
The error is:
Parameter "p_ptr" is null.
fromgodot-cpp/include/godot_cpp/classes/ref.hpp:233 @ convert()
Steps to reproduce
The exact problem occurs when a variable typed as some
RefCounted
type is passed and this variable holdsnull
. When the variable is un-typed,null
is passed directly, or a valid object is passed, no error is printed.GDScript example:
GDExtension example:
Minimal reproduction project
Note: godot-cpp folder is empty in minimal reproduction project, and needs to be fetched (as to not upload too much junk)
Project.zip
The text was updated successfully, but these errors were encountered: