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

Scalar nil pointer safety #369

Merged
merged 1 commit into from
Jul 27, 2018

Conversation

sfriedel
Copy link
Contributor

This fixes a regression when trying to serialize nil pointer values in scalars reported in #365.

The regression was introduced by the merge of #363 because previously the panic in the coercion functions was ignored in completeValueCatchingError and set the field to nil/null.

The change introduces explicit handling for the nil pointers in the scalar coercion functions to prevent the panic from happening.

@coveralls
Copy link

coveralls commented Jul 26, 2018

Coverage Status

Coverage increased (+0.1%) to 91.877% when pulling 986ca8b on civist:scalar-nil-pointer-safety into 2b97f4c on graphql-go:master.

@chris-ramon
Copy link
Member

Thanks lot @sfriedel! this is definitely a great improvement, now it won't bite us again since you added tests for it. 🛡️ 🚢

@chris-ramon chris-ramon merged commit a13937c into graphql-go:master Jul 27, 2018
@sfriedel sfriedel deleted the scalar-nil-pointer-safety branch July 27, 2018 07:41
@sfriedel sfriedel mentioned this pull request Jul 27, 2018
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