summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan <ianb96@gmail.com>2017-11-20 09:49:07 -0500
committerIan <ianb96@gmail.com>2017-11-20 10:27:56 -0500
commit9f308a5bf33d0242268a56699beea99d96b0dcea (patch)
tree95c6e200d49b42627bebf02640b7de64e91b7f81
parent89fc4536693a2b31ed1423998525cfd03fbfec16 (diff)
fix linux crash in _update_scene_tabs
-rw-r--r--editor/editor_node.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 6559048172..ded12db766 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));
}
}