[GH-ISSUE #601] Panic in TextView.Draw #441

Closed
opened 2026-03-04 01:05:02 +03:00 by kerem · 1 comment
Owner

Originally created by @grishy on GitHub (May 19, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/601

Sometimes this error occurs, I have not yet been able to find the reasons depending on the input parameters.
I will update as I search for information...

github.com/rivo/tview v0.0.0-20210312174852-ae9464cc3598
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(0xc00014a000)
        /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/application.go:243 +0x87
panic(0x592a60, 0xc00051f440)
        /snap/go/7360/src/runtime/panic.go:965 +0x1b9
github.com/rivo/tview.(*TextView).Draw(0xc000146200, 0x5dbe40, 0xc00014e240)
        /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/textview.go:1017 +0xded
github.com/rivo/tview.(*Flex).Draw(0xc0000a0b40, 0x5dbe40, 0xc00014e240)
        /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/flex.go:179 +0x292
github.com/rivo/tview.(*Flex).Draw(0xc0000a0bd0, 0x5dbe40, 0xc00014e240)
        /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/flex.go:179 +0x292
github.com/rivo/tview.(*Flex).Draw(0xc0000a0c60, 0x5dbe40, 0xc00014e240)
        /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/flex.go:179 +0x292
github.com/rivo/tview.(*Application).draw(0xc00014a000, 0x0)
        /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/application.go:597 +0xd9
github.com/rivo/tview.(*Application).Draw.func1()
        /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/application.go:550 +0x2a
github.com/rivo/tview.(*Application).Run(0xc00014a000, 0x0, 0x0)
        /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/application.go:376 +0x936
goser/pkg.(*App).Run(0xc00013bab0)
        /home/daniel/Projects/CLionProjects/app/utils/goser/pkg/app.go:183 +0x85
main.main()
        /home/daniel/Projects/CLionProjects/app/utils/goser/main.go:11 +0x52

Originally created by @grishy on GitHub (May 19, 2021). Original GitHub issue: https://github.com/rivo/tview/issues/601 Sometimes this error occurs, I have not yet been able to find the reasons depending on the input parameters. I will update as I search for information... ``` github.com/rivo/tview v0.0.0-20210312174852-ae9464cc3598 ``` ``` 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(0xc00014a000) /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/application.go:243 +0x87 panic(0x592a60, 0xc00051f440) /snap/go/7360/src/runtime/panic.go:965 +0x1b9 github.com/rivo/tview.(*TextView).Draw(0xc000146200, 0x5dbe40, 0xc00014e240) /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/textview.go:1017 +0xded github.com/rivo/tview.(*Flex).Draw(0xc0000a0b40, 0x5dbe40, 0xc00014e240) /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/flex.go:179 +0x292 github.com/rivo/tview.(*Flex).Draw(0xc0000a0bd0, 0x5dbe40, 0xc00014e240) /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/flex.go:179 +0x292 github.com/rivo/tview.(*Flex).Draw(0xc0000a0c60, 0x5dbe40, 0xc00014e240) /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/flex.go:179 +0x292 github.com/rivo/tview.(*Application).draw(0xc00014a000, 0x0) /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/application.go:597 +0xd9 github.com/rivo/tview.(*Application).Draw.func1() /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/application.go:550 +0x2a github.com/rivo/tview.(*Application).Run(0xc00014a000, 0x0, 0x0) /home/daniel/go/pkg/mod/github.com/rivo/tview@v0.0.0-20210312174852-ae9464cc3598/application.go:376 +0x936 goser/pkg.(*App).Run(0xc00013bab0) /home/daniel/Projects/CLionProjects/app/utils/goser/pkg/app.go:183 +0x85 main.main() /home/daniel/Projects/CLionProjects/app/utils/goser/main.go:11 +0x52 ```
kerem closed this issue 2026-03-04 01:05:02 +03:00
Author
Owner

@grishy commented on GitHub (May 19, 2021):

I seem to have found an error
https://github.com/rivo/tview/issues/563#issuecomment-827562945

<!-- gh-comment-id:844347597 --> @grishy commented on GitHub (May 19, 2021): I seem to have found an error https://github.com/rivo/tview/issues/563#issuecomment-827562945
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#441
No description provided.