Skip to content

Commit

Permalink
fix index out of range in InteractiveMultiselectPrinter
Browse files Browse the repository at this point in the history
Closes: #392
  • Loading branch information
adombeck committed Aug 24, 2022
1 parent 2e3f65c commit d9e5425
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions interactive_multiselect_printer.go
Expand Up @@ -227,8 +227,10 @@ func (p *InteractiveMultiselectPrinter) Show(text ...string) ([]string, error) {
cancel()
return true, nil
case keys.Enter:
// Select option if not already selected
p.selectOption(p.fuzzySearchMatches[p.selectedOption])
if len(p.fuzzySearchMatches) > 0 {
// Select option if not already selected
p.selectOption(p.fuzzySearchMatches[p.selectedOption])
}
area.Update(p.renderSelectMenu())
}

Expand Down

0 comments on commit d9e5425

Please sign in to comment.