Skip to content

Commit

Permalink
Merge pull request godotengine#43173 from volzhs/fix-tab-container
Browse files Browse the repository at this point in the history
Fix crash in TabContainer in case of no content at all
  • Loading branch information
akien-mga authored Oct 30, 2020
2 parents f6f38ac + 8a58834 commit debb679
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scene/gui/tab_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,10 @@ void TabContainer::_notification(int p_what) {
// Draw the tab area.
panel->draw(canvas, Rect2(0, header_height, size.width, size.height - header_height));

// Draw selected tab in front
_draw_tab(tab_fg, font_color_fg, current, tabs_ofs_cache + x_current);
// Draw selected tab in front. Need to check tabs.size() in case of no contents at all.
if (tabs.size() > 0) {
_draw_tab(tab_fg, font_color_fg, current, tabs_ofs_cache + x_current);
}

// Draw the popup menu.
x = get_size().width;
Expand Down

0 comments on commit debb679

Please sign in to comment.