diff options
| author | Poommetee Ketson | 2017-11-20 22:35:24 +0700 |
|---|---|---|
| committer | GitHub | 2017-11-20 22:35:24 +0700 |
| commit | 82ad05a20ef4420122b18eadf3835c4a8a49ba19 (patch) | |
| tree | f2a154bec48f45c7a8d0dbdfa90cb9a7c087cb85 /editor/editor_node.cpp | |
| parent | d1831915bf009b263d13cf8fe722e10d48fe1a30 (diff) | |
| parent | 9f308a5bf33d0242268a56699beea99d96b0dcea (diff) | |
| download | godot-82ad05a20ef4420122b18eadf3835c4a8a49ba19.tar.gz godot-82ad05a20ef4420122b18eadf3835c4a8a49ba19.tar.zst godot-82ad05a20ef4420122b18eadf3835c4a8a49ba19.zip | |
Merge pull request #13097 from ianb96/scene_tab_crash_fix
Fixes a crash on linux regarding scene tabs
Diffstat (limited to 'editor/editor_node.cpp')
| -rw-r--r-- | editor/editor_node.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 817e6affb..c0e2e46f1 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -157,7 +157,9 @@ void EditorNode::_update_scene_tabs() { tabbar_container->remove_child(scene_tab_add); scene_tabs->add_child(scene_tab_add); } - Rect2 last_tab = scene_tabs->get_tab_rect(scene_tabs->get_tab_count() - 1); + Rect2 last_tab = Rect2(); + if (scene_tabs->get_tab_count() != 0) + last_tab = scene_tabs->get_tab_rect(scene_tabs->get_tab_count() - 1); scene_tab_add->set_position(Point2(last_tab.get_position().x + last_tab.get_size().x + 3, last_tab.get_position().y)); } } |
