From 55cd92aacd3a0962690d4a8ec4bf3a3b9075a6fb Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Thu, 15 Feb 2018 19:43:21 +0000 Subject: [PATCH] Fixed members overview Index p_index out of size (2.1), issue 12189 --- editor/plugins/script_editor_plugin.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 9d80b4e7940..2c64d2ba325 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -2001,6 +2001,11 @@ struct _ScriptEditorItemData { }; void ScriptEditor::_update_members_overview_visibility() { + int selected = tab_container->get_current_tab(); + if (selected < 0 || selected >= tab_container->get_child_count()) { + return; + } + if (members_overview_enabled) { members_overview->set_hidden(false); } else { @@ -2011,6 +2016,11 @@ void ScriptEditor::_update_members_overview_visibility() { void ScriptEditor::_update_members_overview() { members_overview->clear(); + int selected = tab_container->get_current_tab(); + if (selected < 0 || selected >= tab_container->get_child_count()) { + return; + } + if (tab_container->get_child_count() <= 0) return;