task icon indicating copy to clipboard operation
task copied to clipboard

panic/nil for empty command in included taskfile

Open philpennock opened this issue 2 years ago • 1 comments

This issue is a mix of #338 and #612 -- an empty task causes a crash, but only if the empty task is in an included taskfile.

  • Task version: 3.11.0
    • Task version: v3.11.0 (h1:eCcCe1cKyta4YnGQYLo2FriPS9h7fFS8XBVW6QvWEV4=)
  • Operating System:
    • Ubuntu 20.04 LTS
    • task installed with go install github.com/go-task/task/v3/cmd/task@latest, Go 1.17.7

Example Taskfile showing the issue

  1. Taskfile.yaml:
    version: '3'
    includes:
      a: taskfile-inc.yaml
    
  2. taskfile-inc.yaml
    version: '3'
    tasks:
      bar:
    
$ task -l
panic: runtime error: invalid memory address or nil pointer dereference
[...]

philpennock avatar Feb 25 '22 04:02 philpennock

Thank you for reporting this. I will see if I can add a fix and test coverage in my PR at #656.

tylermmorton avatar Feb 26 '22 02:02 tylermmorton