Skip to content

Commit

Permalink
solved issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonak-Adipta-Kalita committed May 10, 2023
1 parent 0ea5830 commit 2bf7018
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion evaluator/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ func evalForeachExpression(fle *ast.ForeachStatement, env *object.Environment, f

for ok {
child.Set(fle.Identifier.Value, ret)
if fle.Index.Value != "" {
if fle.Index != nil && fle.Index.Value != "" {
child.Set(fle.Index.Value, idx)
}

Expand Down

0 comments on commit 2bf7018

Please sign in to comment.