Explorar o código

Add null check to ScriptEditor get_current_tab_control() call

This fixes #10517
Hein-Pieter van Braam %!s(int64=8) %!d(string=hai) anos
pai
achega
24bc47b179
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      editor/plugins/script_editor_plugin.cpp

+ 4 - 1
editor/plugins/script_editor_plugin.cpp

@@ -2072,7 +2072,10 @@ void ScriptEditor::_update_selected_editor_menu() {
 		}
 	}
 
-	EditorHelp *eh = tab_container->get_current_tab_control()->cast_to<EditorHelp>();
+	EditorHelp *eh = NULL;
+	if (tab_container->get_current_tab_control())
+		eh = tab_container->get_current_tab_control()->cast_to<EditorHelp>();
+
 	if (eh) {
 		script_search_menu->show();
 	} else {