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

Change sanitize function to properly handle null values #4417

Merged
merged 2 commits into from
Jun 25, 2021

Conversation

jonatanschroeder
Copy link
Member

The sanitizeObject function in prairielib uses typeof value === 'object' as a way to check if value is an object, but this expression is also true for null. This has implications in grader hosts, whenever autograders include, in the results, a key that points to null. Instead of treating the object as null, this would trigger a parsing error on the results object. This PR fixes it by handling null values explicitly.

Copy link
Contributor

@nwalters512 nwalters512 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix!

@nwalters512 nwalters512 merged commit 27e279f into master Jun 25, 2021
@nwalters512 nwalters512 deleted the sanitize-null branch June 25, 2021 02:10
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants