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

todoist module panics when trying to clear or delete task in empty project #578

Closed
kognate opened this issue Aug 30, 2019 · 2 comments
Closed
Labels
🐛 bug "Houston, we've had a problem."

Comments

@kognate
Copy link

kognate commented Aug 30, 2019

What's broken?

When using the todoist module, if there is an empty project loaded and you type c or d (clear and delete respectively) you get a crash:

	panic: runtime error: index out of range

goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1(0xc0005b1000)
	/Users/ccummer/go/pkg/mod/github.com/rivo/[email protected]/application.go:149 +0x82
panic(0x191db00, 0x2f8fbb0)
	/usr/local/Cellar/go/1.12.7/libexec/src/runtime/panic.go:522 +0x1b5
github.com/wtfutil/wtf/modules/todoist.(*Project).currentTask(...)
	/Users/ccummer/go/src/github.com/wtfutil/wtf/modules/todoist/project.go:63
github.com/wtfutil/wtf/modules/todoist.(*Project).deleteSelectedTask(0xc00086ac80)
	/Users/ccummer/go/src/github.com/wtfutil/wtf/modules/todoist/project.go:79 +0x10a
github.com/wtfutil/wtf/modules/todoist.(*Widget).Delete(0xc0003fe2c0)
	/Users/ccummer/go/src/github.com/wtfutil/wtf/modules/todoist/widget.go:118 +0x4d
github.com/wtfutil/wtf/view.(*KeyboardWidget).InputCapture(0xc0003fe2c0, 0xc0006c3040, 0xc0007bdd90)
	/Users/ccummer/go/src/github.com/wtfutil/wtf/view/keyboard_widget.go:85 +0xf1
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc0006c3040, 0xc0005222f0)
	/Users/ccummer/go/pkg/mod/github.com/rivo/[email protected]/box.go:157 +0x75
github.com/rivo/tview.(*Application).Run(0xc0005b1000, 0x0, 0x0)
	/Users/ccummer/go/pkg/mod/github.com/rivo/[email protected]/application.go:234 +0x396
main.main()
	/Users/ccummer/go/src/github.com/wtfutil/wtf/main.go:74 +0x288
@senorprogrammer senorprogrammer added the 🐛 bug "Houston, we've had a problem." label Aug 31, 2019
@kognate
Copy link
Author

kognate commented Sep 1, 2019

See also #588

@senorprogrammer
Copy link
Collaborator

Fixed by #588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug "Houston, we've had a problem."
Development

Successfully merging a pull request may close this issue.

2 participants