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