Avoid crash when running pane:activate_prev_item w/ no tabs open

This commit is contained in:
Max Brunsfeld 2021-04-27 11:01:32 -07:00
parent 2a1496be2e
commit 6882fdca38

View file

@ -136,7 +136,7 @@ impl Pane {
pub fn activate_prev_item(&mut self, ctx: &mut ViewContext<Self>) {
if self.active_item > 0 {
self.active_item -= 1;
} else {
} else if self.items.len() > 0 {
self.active_item = self.items.len() - 1;
}
self.focus_active_item(ctx);