Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic: index out of range in InteractiveMultiselectPrinter #392

Closed
adombeck opened this issue Aug 24, 2022 · 0 comments · Fixed by #393
Closed

panic: index out of range in InteractiveMultiselectPrinter #392

adombeck opened this issue Aug 24, 2022 · 0 comments · Fixed by #393
Labels
bug Something isn't working

Comments

@adombeck
Copy link
Contributor

When there are no search matches when the user presses enter, the InteractiveMultiselectPrinter panics:

Please select your options: c
enter: select | tab: confirm | left: none | right: all | type to filter

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/pterm/pterm.(*InteractiveMultiselectPrinter).Show.func1({0xd, {0x0, 0x0, 0x0}, 0x0})
	/home/adrian/go/pkg/mod/github.com/pterm/pterm@v0.12.45/interactive_multiselect_printer.go:231 +0x1032
atomicgo.dev/keyboard.Listen(0xc00010aab0)
	/home/adrian/go/pkg/mod/atomicgo.dev/keyboard@v0.2.8/keyboard.go:107 +0x19b
github.com/pterm/pterm.(*InteractiveMultiselectPrinter).Show(0xc000190000, {0x0, 0x0, 0xc0000061a0?})
	/home/adrian/go/pkg/mod/github.com/pterm/pterm@v0.12.45/interactive_multiselect_printer.go:118 +0x71e
@adombeck adombeck added the bug Something isn't working label Aug 24, 2022
adombeck added a commit to adombeck/pterm that referenced this issue Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant