mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +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
|
/// Returns the index of the currently selected item within the underlying
|
||||||
/// storage vector.
|
/// storage vector.
|
||||||
pub fn item(&self) -> Option<usize> {
|
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
|
None
|
||||||
} else {
|
} else {
|
||||||
Some(self.rows_to_items[self.focus])
|
Some(self.rows_to_items[self.focus])
|
||||||
|
|
Loading…
Reference in a new issue