Material Conversion Error Handling

Material Conversion Plugins now ERR_FAIL if called on an unitialized material.

FileSystemDock no longer crashes if Conversion Plugin fails and returns a null ref.
This commit is contained in:
Colin O'Rourke
2025-07-31 01:33:01 -07:00
parent 2a9ff39264
commit 05fd79af7c
3 changed files with 12 additions and 1 deletions

View File

@ -1900,6 +1900,7 @@ void FileSystemDock::_convert_dialog_action() {
for (const String &target : cached_valid_conversion_targets) {
if (conversion_id == selected_conversion_id && conversion->converts_to() == target) {
Ref<Resource> converted_res = conversion->convert(res);
ERR_FAIL_COND(converted_res.is_null());
ERR_FAIL_COND(res.is_null());
converted_resources.push_back(converted_res);
resources_to_erase_history_for.insert(res);