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: runtime error: index out of range #10

Closed
dharrigan opened this issue Oct 8, 2019 · 3 comments
Closed

panic: runtime error: index out of range #10

dharrigan opened this issue Oct 8, 2019 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@dharrigan
Copy link

dharrigan commented Oct 8, 2019

Hi,

Interesting project, got a panic:

% vsh         
http://vault:8200 /> cd 
panic: runtime error: index out of range

goroutine 1 [running]:
main.executor(0xc00001e216, 0x3)
	/home/fishi/Workspaces/fishi0x01/vsh/main.go:65 +0x6c5
github.com/c-bata/go-prompt.(*Prompt).Run(0xc0001ac400)
	/home/fishi/Workspaces/fishi0x01/vsh/vendor/github.com/c-bata/go-prompt/prompt.go:85 +0x7f2
main.main()
	/home/fishi/Workspaces/fishi0x01/vsh/main.go:144 +0x51a

I did this by simply running up vsh, selecting cd and pressing return without choosing the suggestion.

In fact, it seems to happen with all suggestions, without choosing the suggestion, i.e., cp, rm etc...

@fishi0x01
Copy link
Owner

Yes you are absolutely right. Some sanity checks are still missing. Will add them later today 👍

@fishi0x01 fishi0x01 self-assigned this Oct 8, 2019
@fishi0x01 fishi0x01 added the bug Something isn't working label Oct 8, 2019
@fishi0x01
Copy link
Owner

Merged a fix with some basic sanity checking which should prevent panics like above.
However, more sanity checks / better error handling will be added in the (near) future.

@dharrigan
Copy link
Author

dharrigan commented Oct 8, 2019

Fantastic. Will test.

Yup, much better - no crashing 👍 Thanks for fixing!

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

No branches or pull requests

2 participants