Avoid crash when running pane:activate_prev_item w/ no tabs open
This commit is contained in:
parent
2a1496be2e
commit
6882fdca38
1 changed files with 1 additions and 1 deletions
|
@ -136,7 +136,7 @@ impl Pane {
|
||||||
pub fn activate_prev_item(&mut self, ctx: &mut ViewContext<Self>) {
|
pub fn activate_prev_item(&mut self, ctx: &mut ViewContext<Self>) {
|
||||||
if self.active_item > 0 {
|
if self.active_item > 0 {
|
||||||
self.active_item -= 1;
|
self.active_item -= 1;
|
||||||
} else {
|
} else if self.items.len() > 0 {
|
||||||
self.active_item = self.items.len() - 1;
|
self.active_item = self.items.len() - 1;
|
||||||
}
|
}
|
||||||
self.focus_active_item(ctx);
|
self.focus_active_item(ctx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue