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

Crash when potentialError is null #6896

Closed
Pajn opened this issue Aug 27, 2018 · 3 comments · Fixed by #7049
Closed

Crash when potentialError is null #6896

Pajn opened this issue Aug 27, 2018 · 3 comments · Fixed by #7049

Comments

@Pajn
Copy link
Contributor

Pajn commented Aug 27, 2018

🐛 Bug Report

I got this error in my testsuite:

    TypeError: Cannot read property 'message' of null

      at isError (node_modules/jest-jasmine2/build/is_error.js:20:27)

It seems that isError in jest-jasmine2 does not consider null. The typeof === 'object' check is true for null but the code assumes that succeeding that checks makes it possible to read the property message.
https://github.com/facebook/jest/blob/c93e02718480b9f25b0d28f33456ed159bd11b69/packages/jest-jasmine2/src/is_error.js#L15
A clear and concise description of what the bug is.

This seems to happen when null is thrown inside a promise.

@SimenB
Copy link
Member

SimenB commented Aug 27, 2018

Mind putting together a small repro on e.g. repl.it? Or event better, a PR :)

@Pajn
Copy link
Contributor Author

Pajn commented Aug 27, 2018

It's more work to create a repro than a PR so I will send a PR. I did verify the fix (also checking for null) by modifying the file in node_modules for the affected repo.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants