fix: minor change
This commit is contained in:
parent
4b775101c8
commit
f6bb6789f6
1 changed files with 6 additions and 2 deletions
|
@ -143,7 +143,11 @@ func (c *Cli) GroupsBox() string {
|
|||
case "q", "<C-c>", "<Escape>":
|
||||
return ""
|
||||
case "<Enter>":
|
||||
return l.Rows[l.SelectedRow]
|
||||
if len(l.Rows) == 0 {
|
||||
return ""
|
||||
} else {
|
||||
return l.Rows[l.SelectedRow]
|
||||
}
|
||||
case "j", "<Down>":
|
||||
if len(l.Rows) > 0 {
|
||||
l.ScrollDown()
|
||||
|
@ -292,7 +296,7 @@ func (c *Cli) ListEntries(ch chan<- bool) {
|
|||
ui.Clear()
|
||||
}
|
||||
|
||||
if index >= 0 {
|
||||
if len(entries) > 0 && index >= 0 && index < len(entries) {
|
||||
c.EntryBox(entries[index])
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue