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

Bug: Pressed gg to in a loaded channel #17

Closed
1egoman opened this issue May 27, 2017 · 1 comment
Closed

Bug: Pressed gg to in a loaded channel #17

1egoman opened this issue May 27, 2017 · 1 comment

Comments

@1egoman
Copy link
Owner

1egoman commented May 27, 2017

panic: runtime error: index out of range [recovered]
  panic: runtime error: index out of range

goroutine 61 [running]:
main.main.func1.1(0x15bf1a0, 0xc420080840)
  /home/ubuntu/.go_project/src/github.com/1egoman/slick/main.go:48 +0x7a
panic(0x13b1080, 0x15e3090)
  /usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/1egoman/slick/gateway.(*PrintableMessage).Lines(0xc4206a7b40, 0xbb, 0xc4206a7b40, 0xc4206a7e88, 0x0)
  /home/ubuntu/.go_project/src/github.com/1egoman/slick/gateway/printable_message.go:98 +0x5c5
github.com/1egoman/slick/frontend.(*TerminalDisplay).DrawMessages(0xc42013c010, 0xc42021c000, 0x64, 0x8b, 0x0, 0x5c, 0xc4206a7e88, 0xc420015c20, 0x1396980)
  /home/ubuntu/.go_project/src/github.com/1egoman/slick/frontend/draw_messages.go:289 +0x41b
main.render(0xc4200ca500, 0xc42013c010)
  /home/ubuntu/.go_project/src/github.com/1egoman/slick/render.go:39 +0x1d4
main.keyboardEvents(0xc4200ca500, 0xc42013c010, 0x15bf1a0, 0xc420080840, 0xc4200e2480)
  /home/ubuntu/.go_project/src/github.com/1egoman/slick/keyboard_events.go:691 +0xab
main.main.func1(0x15bf1a0, 0xc420080840, 0xc4200ca500, 0xc42013c010, 0xc4200e2480)
  /home/ubuntu/.go_project/src/github.com/1egoman/slick/main.go:51 +0x87
created by main.main
  /home/ubuntu/.go_project/src/github.com/1egoman/slick/main.go:52 +0x414
@1egoman
Copy link
Owner Author

1egoman commented May 27, 2017

Fixed by e55b665

When a message wrapped across multiple lines and there were zero-words to wrap, the code would explode since zero words to wrap would be an an empty array, and we were getting the last element in that array with a[len(a) - 1.

@1egoman 1egoman closed this as completed May 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant