mirror of
https://github.com/go-task/task.git
synced 2025-03-05 15:05:42 +02:00
fix: nil pointer when version is omitted (#1149)
This commit is contained in:
parent
50d6e057d5
commit
7ec5cac56b
@ -5,6 +5,8 @@
|
||||
- Starting on this release, official binaries for FreeBSD will be available to
|
||||
download (#1068).
|
||||
- Fix some errors being unintendedly supressed (#1134 by @clintmod).
|
||||
- Fix a nil pointer error when `version` is omitted from a Taskfile (#1148,
|
||||
#1149 by @pd93).
|
||||
|
||||
## v3.24.0 - 2023-04-15
|
||||
|
||||
|
@ -6,6 +6,8 @@ import (
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
"github.com/go-task/task/v3/errors"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -71,6 +73,9 @@ func (tf *Taskfile) UnmarshalYAML(node *yaml.Node) error {
|
||||
if tf.Expansions <= 0 {
|
||||
tf.Expansions = 2
|
||||
}
|
||||
if tf.Version == nil {
|
||||
return errors.New("task: 'version' is required")
|
||||
}
|
||||
if tf.Vars == nil {
|
||||
tf.Vars = &Vars{}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user