summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-08-26 22:46:14 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-08-26 22:46:14 +0200
commit7e8fffa008de371d844dc9f23b9f3e32944fd51d (patch)
treeb798bfe2e4b926d85e1f5f80f5ee0e1a03aa5223
parentb5603ed8e25d109a007e015111ffb0102926762a (diff)
parent064f471103c70b3495a592e40cf6df306fdc8b58 (diff)
downloadredot-engine-7e8fffa008de371d844dc9f23b9f3e32944fd51d.tar.gz
Merge pull request #96122 from SaracenOne/fix_post_import_regression
Prevent empty post-import script paths throwing errors.
-rw-r--r--editor/import/3d/resource_importer_scene.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/import/3d/resource_importer_scene.cpp b/editor/import/3d/resource_importer_scene.cpp
index e259181187..d0d7142c01 100644
--- a/editor/import/3d/resource_importer_scene.cpp
+++ b/editor/import/3d/resource_importer_scene.cpp
@@ -3058,13 +3058,13 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
progress.step(TTR("Running Custom Script..."), 2);
String post_import_script_path = p_options["import_script/path"];
- if (post_import_script_path.is_relative_path()) {
- post_import_script_path = p_source_file.get_base_dir().path_join(post_import_script_path);
- }
Ref<EditorScenePostImport> post_import_script;
if (!post_import_script_path.is_empty()) {
+ if (post_import_script_path.is_relative_path()) {
+ post_import_script_path = p_source_file.get_base_dir().path_join(post_import_script_path);
+ }
Ref<Script> scr = ResourceLoader::load(post_import_script_path);
if (!scr.is_valid()) {
EditorNode::add_io_error(TTR("Couldn't load post-import script:") + " " + post_import_script_path);