mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
fix: panic for empty hash var ({}) (#2417)
This commit is contained in:
@@ -18,7 +18,10 @@ type Var struct {
|
|||||||
func (v *Var) UnmarshalYAML(node *yaml.Node) error {
|
func (v *Var) UnmarshalYAML(node *yaml.Node) error {
|
||||||
switch node.Kind {
|
switch node.Kind {
|
||||||
case yaml.MappingNode:
|
case yaml.MappingNode:
|
||||||
key := node.Content[0].Value
|
key := "<none>"
|
||||||
|
if len(node.Content) > 0 {
|
||||||
|
key = node.Content[0].Value
|
||||||
|
}
|
||||||
switch key {
|
switch key {
|
||||||
case "sh", "ref", "map":
|
case "sh", "ref", "map":
|
||||||
var m struct {
|
var m struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user