summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-19 15:24:19 +0200
committerGitHub <noreply@github.com>2021-05-19 15:24:19 +0200
commitf1f5b92b8e84541759e7dc38aa85da036027ba06 (patch)
treeb68fe37c67a89e26d52cd6b5943812010b916b6e
parent8348332f49bd11f54e6a1f4fc432def475b0fd47 (diff)
parent16876bec76528ce5c4e84aad66bc98cdbcd62e97 (diff)
Merge pull request #48818 from Calinou/fix-script-editor-save-crash
Fix crash when trying to save with no scenes and scripts open
-rw-r--r--editor/plugins/script_editor_plugin.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 0512c148cc..a4fbc57e6b 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2281,8 +2281,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;
}