1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

fix: bug where undefined/null variables resolve to "" instead of nil (#2144)

This commit is contained in:
Pete Davison
2025-03-30 20:21:02 +01:00
committed by GitHub
parent 60e28ecdcc
commit 03b242d4c3

View File

@@ -75,7 +75,7 @@ func (c *Compiler) getVariables(t *ast.Task, call *Call, evaluateShVars bool) (*
return err
}
// If the variable is already set, we can set it and return
if newVar.Value != nil {
if newVar.Value != nil || newVar.Sh == nil {
result.Set(k, ast.Var{Value: newVar.Value})
return nil
}