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]] Skip undefined env in getHomeDir() #3245
base: main
Are you sure you want to change the base?
Conversation
Skip calling `fs.existsSync()` on an environment variable when it is undefined.
Side note: I was a bit surprised that JSHint is not in the CITGM list, is there a previous discussion about this? (Have not found anything by searching in the CITGM repo) Would you consider joining that list? JSHint seem to meet a lot of requirements of CITGM. |
1 similar comment
Thanks for the patch! And for the recommendation. Including JSHint in the citgm project sounds like a great idea! I'm not sure if JSHint's non-free license disqualifies it, though, so I've filed an issue to find out. We'll want to fix this bug regardless, though. Would you mind adding a test so that we don't regress? |
@jugglinmike I believe this test Lines 526 to 533 in 157a508
already severs as a regression test, since it makes all the home env variables undefined. Without this patch, if node throws on |
Skip calling
fs.existsSync()
on an environment variable when it is undefined.Discovered during the CITGM run of nodejs/node#18308
https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1229/nodes=fedora-latest-x64/testReport/junit/(root)/citgm/bluebird_v3_5_1/
Before this patch, if
fs.existsSync(undefined)
throws, the test would fail like this: