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

Panics when pressing 'g' too many times #55

Open
sigurd4 opened this issue Nov 19, 2024 · 3 comments
Open

Panics when pressing 'g' too many times #55

sigurd4 opened this issue Nov 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@sigurd4
Copy link

sigurd4 commented Nov 19, 2024

Pressing 'g' to cycle through links on an article crashed the program when i went from the final url.

Caught panic:

runtime error: index out of range [2] with length 2

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
	runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
	github.com/charmbracelet/[email protected]/tea.go:402 +0x8b
panic({0x5c7a20bfa600?, 0xc0011a48a0?})
	runtime/panic.go:785 +0x132
github.com/TypicalAM/goread/internal/ui/tab/feed.(*selector).cycle(0xc00061c228?)
	github.com/TypicalAM/goread/internal/ui/tab/feed/selector.go:103 +0x90d
github.com/TypicalAM/goread/internal/ui/tab/feed.Model.Update({{0x0, 0x1, 0x0, 0x1, 0x0, 0x1, {0x5c7a2090409d, 0x4}, {0x5c7a20906e34, 0x5}, ...}, ...}, ...)
	github.com/TypicalAM/goread/internal/ui/tab/feed/feed.go:211 +0x22e5
github.com/TypicalAM/goread/internal/ui/browser.Model.Update({{0x0, 0x0}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, ...}, ...}, ...}, ...)
	github.com/TypicalAM/goread/internal/ui/browser/browser.go:304 +0x2118
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0xc000152370, {0x5c7a20c4d400?, 0xc000263b08?}, 0xc000a570a0)
	github.com/charmbracelet/[email protected]/tea.go:343 +0x47c
github.com/charmbracelet/bubbletea.(*Program).Run(0xc000152370)
	github.com/charmbracelet/[email protected]/tea.go:465 +0x7ab
github.com/TypicalAM/goread/cmd/goread.Run()
	github.com/TypicalAM/goread/cmd/goread/goread.go:182 +0x90a
github.com/TypicalAM/goread/cmd/goread.init.func1(0xc000016100?, {0x5c7a2090f36f?, 0x7?, 0x5c7a20903f95?})
	github.com/TypicalAM/goread/cmd/goread/goread.go:44 +0x17
github.com/spf13/cobra.(*Command).execute(0x5c7a21203b60, {0xc00012a270, 0x0, 0x0})
	github.com/spf13/[email protected]/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0x5c7a21203b60)
	github.com/spf13/[email protected]/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:968
github.com/TypicalAM/goread/cmd/goread.Execute()
	github.com/TypicalAM/goread/cmd/goread/goread.go:73 +0x1e
main.main()
	github.com/TypicalAM/goread/main.go:11 +0x4e
@TypicalAM
Copy link
Owner

Is there a chance you could provide the failing feed?

@TypicalAM TypicalAM added the bug Something isn't working label Nov 21, 2024
@sigurd4
Copy link
Author

sigurd4 commented Nov 22, 2024

It happens to any feed if you do it on the last available entry in the feed

@TypicalAM
Copy link
Owner

TypicalAM commented Nov 23, 2024

Unfortunately I'm not able to reproduce neither on kitty/linux nor on windows terminal/windows on go 1.22.9, goread v1.7.0. Could you provide info like:

  • echo $TERM $LSCOLORS && tput cols && tput lines
  • go version
  • goread --version
  • Terminal emulator that you are using

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants