diff options
| author | Ian | 2017-11-20 09:49:07 -0500 |
|---|---|---|
| committer | Ian | 2017-11-20 10:27:56 -0500 |
| commit | 9f308a5bf33d0242268a56699beea99d96b0dcea (patch) | |
| tree | 95c6e200d49b42627bebf02640b7de64e91b7f81 /editor/editor_node.cpp | |
| parent | 89fc4536693a2b31ed1423998525cfd03fbfec16 (diff) | |
| download | godot-9f308a5bf33d0242268a56699beea99d96b0dcea.tar.gz godot-9f308a5bf33d0242268a56699beea99d96b0dcea.tar.zst godot-9f308a5bf33d0242268a56699beea99d96b0dcea.zip | |
fix linux crash in _update_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 655904817..ded12db76 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)); } } |
