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] getActiveTrack crashes when chaining patterns if the next patter does not have the active track #15

Closed
ajboni opened this issue Aug 11, 2024 · 0 comments

Comments

@ajboni
Copy link
Contributor

ajboni commented Aug 11, 2024

When a pattern chains to another, and the next patter does not includes the current active track, it crashes the application

Reproduce:

  1. set up pattern chaining p1 to p2
  2. add a track to p1, focus on this new track
  3. press play
  4. wait the chain to apply. Notice crash.
Caught panic:

runtime error: index out of range [3] with length 1

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
        /usr/lib/go/src/runtime/debug/stack.go:24 +0x5e
runtime/debug.PrintStack()
        /usr/lib/go/src/runtime/debug/stack.go:16 +0x13
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
        /home/baj/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:479 +0x91
panic({0x593b60?, 0xc0003142b8?})
        /usr/lib/go/src/runtime/panic.go:770 +0x132
sektron/ui.(*mainModel).getActiveTrack(...)
        /home/baj/git/sektron/ui/ui.go:406
sektron/ui.mainModel.renderTransport({{0x5ff8b8, 0xc0000c85a0}, {{0xc000256008, 0x8a, 0xff}, {0xc000260008, 0x89, 0xbf}, 0xc000190030, {0x0, ...}, ...}, ...})
        /home/baj/git/sektron/ui/transport.go:68 +0x510
sektron/ui.mainModel.View({{0x5ff8b8, 0xc0000c85a0}, {{0xc000256008, 0x8a, 0xff}, {0xc000260008, 0x89, 0xbf}, 0xc000190030, {0x0, ...}, ...}, ...})
        /home/baj/git/sektron/ui/ui.go:384 +0x3d
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0xc000234100, {0x5fe4e8?, 0xc000320008?}, 0xc0000256e0)
        /home/baj/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:414 +0x707
github.com/charmbracelet/bubbletea.(*Program).Run(0xc000234100)
        /home/baj/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:550 +0xa0e
main.main()
        /home/baj/git/sektron/main.go:45 +0x478

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