mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-20 19:11:08 +03:00
fix: panic in TUI table selected item. focus is zero indexed (#3169)
This commit is contained in:
parent
bde19777f0
commit
0fba087aa1
1 changed files with 1 additions and 1 deletions
|
@ -502,7 +502,7 @@ impl<T: TableViewItem<H> + PartialEq, H: Eq + Hash + Copy + Clone + 'static> Tab
|
|||
/// Returns the index of the currently selected item within the underlying
|
||||
/// storage vector.
|
||||
pub fn item(&self) -> Option<usize> {
|
||||
if self.items.is_empty() || self.focus > self.rows_to_items.len() {
|
||||
if self.items.is_empty() || self.focus >= self.rows_to_items.len() {
|
||||
None
|
||||
} else {
|
||||
Some(self.rows_to_items[self.focus])
|
||||
|
|
Loading…
Reference in a new issue