From 0c4a9dc32caf134f7a246164b19a1e6483aeb77c Mon Sep 17 00:00:00 2001 From: akshat-loya Date: Thu, 29 Jan 2026 00:17:43 +0530 Subject: [PATCH] Adding a check to make sure that p_material_data has the required data corresponding to mat_id. Similar checks are present for blocks above and below this one. This avoids accessing a value in the Dictionary that is not yet defined and thereby resolves the error being thrown. --- editor/import/3d/resource_importer_scene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/import/3d/resource_importer_scene.cpp b/editor/import/3d/resource_importer_scene.cpp index fc686d01e9..1056dc82cb 100644 --- a/editor/import/3d/resource_importer_scene.cpp +++ b/editor/import/3d/resource_importer_scene.cpp @@ -1598,7 +1598,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, HashMap< post_importer_plugins.write[j]->internal_process(EditorScenePostImportPlugin::INTERNAL_IMPORT_CATEGORY_MATERIAL, p_root, p_node, mat, matdata); } } - if (!mat_id.is_empty() && extract_mat != 0) { + if (!mat_id.is_empty() && p_material_data.has(mat_id) && extract_mat != 0) { String ext = material_extension[p_options.has("materials/extract_format") ? (int)p_options["materials/extract_format"] : 0]; String path = spath.path_join(mat_id.validate_filename() + ext); String uid_path = ResourceUID::path_to_uid(path);