mirror of
https://github.com/nushell/nushell.git
synced 2024-11-23 00:43:33 +01:00
Fix menu panic for empty examples. (#5581)
This commit is contained in:
parent
2b1e05aad0
commit
ac30b3d108
@ -586,7 +586,7 @@ impl Menu for DescriptionMenu {
|
||||
} else {
|
||||
self.example_index = Some(self.examples.len().saturating_sub(1));
|
||||
}
|
||||
} else {
|
||||
} else if !self.examples.is_empty() {
|
||||
self.example_index = Some(0);
|
||||
}
|
||||
}
|
||||
@ -598,7 +598,7 @@ impl Menu for DescriptionMenu {
|
||||
} else {
|
||||
self.example_index = Some(0);
|
||||
}
|
||||
} else {
|
||||
} else if !self.examples.is_empty() {
|
||||
self.example_index = Some(0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user