mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 13:55:51 +03:00
[GH-ISSUE #407] Panic when press UP on empty list #298
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#298
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BronOS on GitHub (Feb 17, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/407
There is an panic when list is empty and change function is set up on key press UP:
panic: runtime error: index out of range [-1] [recovered]
panic: runtime error: index out of range [-1]
goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1(0xc0000d8180)
/Users/bronos/Projects/go/src/github.com/BronOS/pkg/mod/github.com/rivo/tview@v0.0.0-20200204110323-ae3d8cac5e4b/application.go:160 +0x82
panic(0x1189ae0, 0xc0003ec000)
/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/rivo/tview.(*List).InputHandler.func1(0xc0003e8000, 0xc0003ea010)
/Users/bronos/Projects/go/src/github.com/BronOS/pkg/mod/github.com/rivo/tview@v0.0.0-20200204110323-ae3d8cac5e4b/list.go:547 +0x378
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc0003e8000, 0xc0003ea010)
/Users/bronos/Projects/go/src/github.com/BronOS/pkg/mod/github.com/rivo/tview@v0.0.0-20200204110323-ae3d8cac5e4b/box.go:160 +0x5d
github.com/rivo/tview.(*Application).Run(0xc0000d8180, 0x0, 0x0)
/Users/bronos/Projects/go/src/github.com/BronOS/pkg/mod/github.com/rivo/tview@v0.0.0-20200204110323-ae3d8cac5e4b/application.go:245 +0x3c0
main.main()
/Users/bronos/Projects/go/src/github.com/BronOS/tview_test/main.go:12 +0x21b