diff --git a/gpm/cli.go b/gpm/cli.go index 4228438..cf9d2f4 100644 --- a/gpm/cli.go +++ b/gpm/cli.go @@ -143,7 +143,11 @@ func (c *Cli) GroupsBox() string { case "q", "", "": return "" case "": - return l.Rows[l.SelectedRow] + if len(l.Rows) == 0 { + return "" + } else { + return l.Rows[l.SelectedRow] + } case "j", "": 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]) }