Skip to content

shell/syntax: guard Walk against nil node - #819

Merged
ewhauser merged 1 commit into
mainfrom
ewhauser/walk-nil-check
Apr 2, 2026
Merged

ewhauser merged 1 commit into
mainfrom
ewhauser/walk-nil-check

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • Add nil check for the node parameter in Walk before invoking the visitor function, preventing panics when optional AST children are nil.

Test plan

  • Existing shell/syntax tests continue to pass.
  • Verify Walk(nil, f) returns immediately without calling f.

Callers can pass a nil Node to Walk (e.g. optional AST children);
without this check the visitor function receives nil, which can panic.
Return early when node is nil before invoking the visitor.
@ewhauser
ewhauser merged commit a99b81c into main Apr 2, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/walk-nil-check branch April 2, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant