Merge pull request #108381 from timothyqiu/shader-side-toggle

Fix error when "Toggle Files Panel" in shader editor
This commit is contained in:
Thaddeus Crews 2025-07-24 14:23:47 -05:00
commit 0d1d3ead8b
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -635,7 +635,8 @@ void ShaderEditorPlugin::_menu_item_pressed(int p_index) {
shader_list->set_visible(!shader_list->is_visible());
int index = shader_tabs->get_current_tab();
ERR_FAIL_INDEX(index, shader_tabs->get_tab_count());
if (index != -1) {
ERR_FAIL_INDEX(index, (int)edited_shaders.size());
TextShaderEditor *editor = Object::cast_to<TextShaderEditor>(edited_shaders[index].shader_editor);
if (editor) {
editor->get_code_editor()->update_toggle_files_button();
@ -645,6 +646,7 @@ void ShaderEditorPlugin::_menu_item_pressed(int p_index) {
vs_editor->update_toggle_files_button();
}
}
}
} break;
}
}