Browse Source

C#: Fix command line exporting

(cherry picked from commit f3f3365abd7792a34469de0e9a4688500b26bf04)
RedworkDE 2 years ago
parent
commit
3f334cb144
2 changed files with 2 additions and 1 deletions
  1. 1 0
      editor/editor_file_system.cpp
  2. 1 1
      modules/mono/csharp_script.cpp

+ 1 - 0
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;
 

+ 1 - 1
modules/mono/csharp_script.cpp

@@ -2272,7 +2272,7 @@ void CSharpScript::reload_registered_script(Ref<CSharpScript> 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