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

Error while trying to add new row in empty table #50

Closed
maciejlewandowskii opened this issue Apr 13, 2024 · 1 comment · Fixed by #72
Closed

Error while trying to add new row in empty table #50

maciejlewandowskii opened this issue Apr 13, 2024 · 1 comment · Fixed by #72

Comments

@maciejlewandowskii
Copy link

In addition, it will be nice if there was some message "Table Empty" instead of error

Full panic error:

panic: runtime error: index out of range [0] with length 0 [recovered]
        panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1()
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/application.go:251 +0x4d
panic({0x782400, 0xc0006a6c78})
        /usr/local/go/src/runtime/panic.go:884 +0x213
github.com/jorgerojas26/lazysql/components.(*ResultsTable).tableInputCapture(0xc000266d80, 0xc0006ddc60)
        /Users/jorgerojas/projects/lazysql/components/ResultsTable.go:448 +0x1468
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc000270720?, 0xc0005c7b08?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/box.go:164 +0x3a
github.com/rivo/tview.(*Flex).InputHandler.func1(0xc0005c7b48?, 0x54e0bf?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/flex.go:255 +0xd9
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc0002701e0?, 0xc0005c7b88?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/box.go:167 +0x53
github.com/rivo/tview.(*Pages).InputHandler.func1(0xc0005c7bc8?, 0x558dbf?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/pages.go:311 +0xa7
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc000270240?, 0xc0005c7c08?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/box.go:167 +0x53
github.com/rivo/tview.(*Pages).InputHandler.func1(0xc0005c7c48?, 0x558dbf?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/pages.go:311 +0xa7
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc0000fe5d0?, 0xc0005c7c88?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/box.go:167 +0x53
github.com/rivo/tview.(*Flex).InputHandler.func1(0xc0005c7cc8?, 0x54e0bf?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/flex.go:255 +0xd9
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc0000fe630?, 0x76d6e0?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/box.go:167 +0x53
github.com/rivo/tview.(*Flex).InputHandler.func1(0xc0006ef7e0?, 0xc0005c7d48?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/flex.go:255 +0xd9
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc00007f2f0?, 0x7620e0?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/box.go:167 +0x53
github.com/rivo/tview.(*Pages).InputHandler.func1(0x40d507?, 0x10?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/pages.go:311 +0xa7
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc00007f110?, 0xc0005c7e40?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/box.go:167 +0x53
github.com/rivo/tview.(*Application).Run(0xc00017e000)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/tview@v0.0.0-20240101144852-b3bd1aa5e9f2/application.go:344 +0x57d
main.main()
        /Users/jorgerojas/projects/lazysql/main.go:16 +0x10a
@jorgerojas26
Copy link
Owner

@maciejlewandowskii can you check if #72 solves the issue?

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

Successfully merging a pull request may close this issue.

2 participants