You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Fix crash when restoring script editor state
This commit is contained in:
@@ -2507,19 +2507,25 @@ void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) {
|
|||||||
if (!scr.is_valid()) {
|
if (!scr.is_valid()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
edit(scr);
|
if (!edit(scr)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Error error;
|
Error error;
|
||||||
Ref<TextFile> text_file = _load_text_file(path, &error);
|
Ref<TextFile> text_file = _load_text_file(path, &error);
|
||||||
if (error != OK || !text_file.is_valid()) {
|
if (error != OK || !text_file.is_valid()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
edit(text_file);
|
if (!edit(text_file)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!script_info.empty()) {
|
if (!script_info.empty()) {
|
||||||
ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_child(i));
|
ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_child(tab_container->get_tab_count() - 1));
|
||||||
se->set_edit_state(script_info["state"]);
|
if (se) {
|
||||||
|
se->set_edit_state(script_info["state"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user