You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevent panic on nil intermediate values during Set operations
Add nil checks in setSingleImpl() and traversal loop to handle nil
intermediate values gracefully. Per RFC 6901 Section 7, implementations
must raise error conditions for unresolvable paths instead of panicking.
- Add isNil() check before reflection operations in setSingleImpl()
- Add nil validation in set() method traversal loop
- Return descriptive errors: "cannot set field X on nil value"
- Add comprehensive test cases for nil traversal scenarios
Fixes panic: "reflect: call of reflect.Value.Type on zero Value" when
traversing JSON paths containing nil intermediate values.
Signed-off-by: Matthew F Leader <[email protected]>
0 commit comments