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

Fix for TypeError when redact called with leading wildcard and null property #14

Merged
merged 1 commit into from
Feb 11, 2019

Conversation

n4zukker
Copy link
Contributor

This change set includes a test which illustrates the problem and a suggested fix.

To recap:

Problem is that: path such as ['*.password'] gives a type error when redacting an object with a null property, {foo: null}.

Reason: a variable was missing an initial value in its declaration

specialSet was returning  `{value, exists}` (no parent) for cases where
the key's value was null.  It is supposed to return a `{value, parent,
exists}` triplet.  Without `parent`, we get the `TypeError` because the
parent is used in assignment statements.

Set the `oov` variable to `null` on the declaration line.
Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@n4zukker
Copy link
Contributor Author

Hi. Would someone kindly merge this PR or let me know what needs to be done to have it merged. Thank you.

@mcollina mcollina merged commit 5469148 into davidmarkclements:master Feb 11, 2019
@n4zukker
Copy link
Contributor Author

Thank you

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.

2 participants