You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Fix import and saving related crashes
* Don't add empty mesh to result when importing obj files * Check for null resources in `ResourceSaver`
This commit is contained in:
@@ -152,12 +152,10 @@ void ResourceLoader::_bind_methods() {
|
||||
////// ResourceSaver //////
|
||||
|
||||
Error ResourceSaver::save(const Ref<Resource> &p_resource, const String &p_path, BitField<SaverFlags> p_flags) {
|
||||
ERR_FAIL_COND_V_MSG(p_resource.is_null(), ERR_INVALID_PARAMETER, "Can't save empty resource to path '" + p_path + "'.");
|
||||
return ::ResourceSaver::save(p_resource, p_path, p_flags);
|
||||
}
|
||||
|
||||
Vector<String> ResourceSaver::get_recognized_extensions(const Ref<Resource> &p_resource) {
|
||||
ERR_FAIL_COND_V_MSG(p_resource.is_null(), Vector<String>(), "It's not a reference to a valid Resource object.");
|
||||
List<String> exts;
|
||||
::ResourceSaver::get_recognized_extensions(p_resource, &exts);
|
||||
Vector<String> ret;
|
||||
|
||||
Reference in New Issue
Block a user