1
0
mirror of https://github.com/go-task/task.git synced 2025-04-18 12:04:04 +03: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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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
}