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

Add guard for undefined objects in addModifier #1667

Merged
merged 1 commit into from
Jun 4, 2019
Merged

Conversation

lencioni
Copy link
Contributor

@lencioni lencioni commented Jun 4, 2019

After updating to v20.2.1, we started seeing a handful of errors about
undefined is not an object coming from these addModifier calls. It
isn't entirely clear to me how this happens, but I think we can prevent
it from being a problem by adding some guards in these codepaths.

@lencioni lencioni added the semver-patch: fixes/refactors/etc Anything that's not major or minor. label Jun 4, 2019
@coveralls
Copy link

coveralls commented Jun 4, 2019

Coverage Status

Coverage remained the same at 84.14% when pulling d6304cb on undefined into ae3b1a6 on master.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Change seems fine, but I’d prefer not to merge it without a regression test.

@lencioni
Copy link
Contributor Author

lencioni commented Jun 4, 2019

@ljharb Totally agreed about the test, but I wasn't sure how this could happen so I wasn't sure how to write the test. Reading over the code again though, I think I see what I got confused about and I'll try to get a test in (I think I can also simplify my change).

After updating to v20.2.1, we started seeing a handful of errors about
`undefined is not an object` coming from these addModifier calls. It
isn't entirely clear to me how this happens, but I think we can prevent
it from being a problem by adding some guards in these codepaths.
@lencioni
Copy link
Contributor Author

lencioni commented Jun 4, 2019

@ljharb PR updated, PTAL

@lencioni lencioni merged commit d6304cb into master Jun 4, 2019
@ljharb ljharb deleted the undefined branch June 4, 2019 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch: fixes/refactors/etc Anything that's not major or minor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants