godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.75k stars 577 forks source link

Don't print an error when decoding a null Ref<T> #1616

Open dsnopek opened 1 month ago

dsnopek commented 1 month ago

Fixes https://github.com/godotengine/godot-cpp/issues/1615

It's not an error to receive a null pointer for a Ref<T> - that's just how null reference values are encoded - so we shouldn't print an error message. This switches away from ERR_FAIL_NULL_V() to just a normal if statement.

dsnopek commented 3 weeks ago

Discussed at the GDExtension meeting and folks thought it looked good.