Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix crash when opening ShaderEditorDock with a VisualShader open

GabCoolGuya6a521b097dc
diff --git a/editor/script/script_editor_plugin.cpp b/editor/script/script_editor_plugin.cpp
index da5b695e3d3..7f85a54ad2a 100644
--- a/editor/script/script_editor_plugin.cpp
+++ b/editor/script/script_editor_plugin.cpp
@@ -2715,7 +2715,7 @@ Vector<Control *> DocumentEditorContainer::get_all_editors() const {
void DocumentEditorContainer::focus_active_editor() {
ScriptEditorBase *seb = Object::cast_to<ScriptEditorBase>(get_active_editor());
EditorHelp *eh = Object::cast_to<EditorHelp>(get_active_editor());
- if (seb) {
+ if (seb && seb->get_base_editor()) {
seb->get_base_editor()->grab_focus();
} else if (eh) {
eh->set_focused();