summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-05-18 19:43:54 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-05-18 19:48:38 +0200
commit16876bec76528ce5c4e84aad66bc98cdbcd62e97 (patch)
treecfe67da2114b1491023656ee66d945c529c8c6c1
parentcc57bb9add305f9dafb71a63f12168349bd030ca (diff)
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).
-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;
}