Skip to content

Commit 03b242d

Browse files
authored
fix: bug where undefined/null variables resolve to "" instead of nil (#2144)
1 parent 60e28ec commit 03b242d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (c *Compiler) getVariables(t *ast.Task, call *Call, evaluateShVars bool) (*
7575
return err
7676
}
7777
// If the variable is already set, we can set it and return
78-
if newVar.Value != nil {
78+
if newVar.Value != nil || newVar.Sh == nil {
7979
result.Set(k, ast.Var{Value: newVar.Value})
8080
return nil
8181
}

0 commit comments

Comments
 (0)