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

Running task with an empty taskfile causes a nil pointer dereference #1341

Closed
lukejoshuapark opened this issue Sep 19, 2023 · 1 comment · Fixed by #1342
Closed

Running task with an empty taskfile causes a nil pointer dereference #1341

lukejoshuapark opened this issue Sep 19, 2023 · 1 comment · Fixed by #1342
Labels
area: parser Changes related to parsing Taskfiles.

Comments

@lukejoshuapark
Copy link

  • Task version: 3.30.1
  • Operating system: Ubuntu Dev-Container
  • Experiments enabled: None

To reproduce:

  • Create an empty Taskfile.yml in a directory.
  • Run task in that directory.

Example panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6191bd]

goroutine 1 [running]:
github.com/Masterminds/semver/v3.(*Version).Compare(0x94fbc0?, 0xc0000976e0?)
        github.com/Masterminds/semver/[email protected]/version.go:406 +0x1d
github.com/go-task/task/v3/taskfile/read.Taskfile.func1({0x94fbc0?, 0xc0000976e0})
        github.com/go-task/task/[email protected]/taskfile/read/taskfile.go:262 +0x186
github.com/go-task/task/v3/taskfile/read.Taskfile({0x94fbc0?, 0xc0000976e0?}, 0x88?, 0xfb?, 0xf?, {0xc0000e4ec0?, 0x0?}, 0x0?)
        github.com/go-task/task/[email protected]/taskfile/read/taskfile.go:300 +0x89
github.com/go-task/task/v3.(*Executor).readTaskfile(0xc00011c2c0)
        github.com/go-task/task/[email protected]/setup.go:89 +0x98
github.com/go-task/task/v3.(*Executor).Setup(0xc00011c2c0)
        github.com/go-task/task/[email protected]/setup.go:33 +0xd3
main.run()
        github.com/go-task/task/[email protected]/cmd/task/task.go:267 +0xf3f
main.main()
        github.com/go-task/task/[email protected]/cmd/task/task.go:80 +0x1f
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Sep 19, 2023
@pd93 pd93 added type: bug Something not working as intended. area: parser Changes related to parsing Taskfiles. and removed state: needs triage Waiting to be triaged by a maintainer. labels Sep 19, 2023
@pd93
Copy link
Member

pd93 commented Sep 19, 2023

@lukejoshuapark Thanks for reporting, this will be fixed in the next release

@pd93 pd93 removed the type: bug Something not working as intended. label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: parser Changes related to parsing Taskfiles.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants