Use RequiredParam and RequiredResult in a handful of places in order to test

This commit is contained in:
David Snopek
2025-10-08 16:37:43 -05:00
parent d95d49ee12
commit 090a4540b7
10 changed files with 68 additions and 68 deletions

View File

@@ -97,8 +97,8 @@ void ResourceFormatSaver::_bind_methods() {
GDVIRTUAL_BIND(_recognize_path, "resource", "path");
}
Error ResourceSaver::save(const Ref<Resource> &p_resource, const String &p_path, uint32_t p_flags) {
ERR_FAIL_COND_V_MSG(p_resource.is_null(), ERR_INVALID_PARAMETER, vformat("Can't save empty resource to path '%s'.", p_path));
Error ResourceSaver::save(RequiredParam<Resource> rp_resource, const String &p_path, uint32_t p_flags) {
EXTRACT_PARAM_OR_FAIL_V_MSG(p_resource, rp_resource, ERR_INVALID_PARAMETER, vformat("Can't save empty resource to path '%s'.", p_path));
String path = p_path;
if (path.is_empty()) {
path = p_resource->get_path();