Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid panic when calling Elem on a nil map member. #941

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

robshakir
Copy link
Contributor

 * (M) ygot/struct_validation_map(_test)?.go
   - if a map was received that had a nil value in it, this caused
     a panic to occur since `(reflect.Value).Elem()` does not handle
     these cases cleanly. Add a check whether the value is nil before
     calling Elem.

 * (M) ygot/struct_validation_map(_test)?.go
   - if a map was received that had a nil value in it, this caused
     a panic to occur since `(reflect.Value).Elem()` does not handle
     these cases cleanly. Add a check whether the value is nil before
     calling Elem.
@robshakir robshakir requested a review from wenovus December 11, 2023 22:16
@coveralls
Copy link

Coverage Status

coverage: 89.612% (+0.002%) from 89.61%
when pulling b7a874c on copy-reflect-panic
into 4dcc65e on master.

@robshakir robshakir merged commit 8efc814 into master Dec 12, 2023
10 checks passed
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.

3 participants