From a45db4c208d0689df64fd64193d8de39532897bb Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 18 May 2021 19:43:54 +0200 Subject: [PATCH] Fix crash when trying to save with no scenes and scripts open This could occur when attempting to save project settings when no scenes or scripts are open (which is common in a brand new project). (cherry picked from commit 16876bec76528ce5c4e84aad66bc98cdbcd62e97) --- editor/plugins/script_editor_plugin.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 24b457af15b..fb84a190ded 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -2151,8 +2151,7 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra void ScriptEditor::save_current_script() { ScriptEditorBase *current = _get_current_editor(); - - if (_test_script_times_on_disk()) { + if (!current || _test_script_times_on_disk()) { return; }