From 3f334cb1441ee8b77f7accea7e794442c0fcebf5 Mon Sep 17 00:00:00 2001 From: RedworkDE <10944644+RedworkDE@users.noreply.github.com> Date: Fri, 7 Jul 2023 20:51:46 +0200 Subject: [PATCH] C#: Fix command line exporting (cherry picked from commit f3f3365abd7792a34469de0e9a4688500b26bf04) --- editor/editor_file_system.cpp | 1 + modules/mono/csharp_script.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index b71c66d776f..914e146d13b 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1635,6 +1635,7 @@ void EditorFileSystem::_queue_update_script_class(const String &p_path) { } void EditorFileSystem::update_file(const String &p_file) { + ERR_FAIL_COND(p_file.is_empty()); EditorFileSystemDirectory *fs = nullptr; int cpos = -1; diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 3e032f213b4..1ed495943f1 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -2272,7 +2272,7 @@ void CSharpScript::reload_registered_script(Ref p_script) { // If the EditorFileSystem singleton is available, update the file; // otherwise, the file will be updated when the singleton becomes available. EditorFileSystem *efs = EditorFileSystem::get_singleton(); - if (efs) { + if (efs && !p_script->get_path().is_empty()) { efs->update_file(p_script->get_path()); } #endif