Repository navigation
[[FIX]] Skip undefined env in getHomeDir() - #3245
joyeecheung wants to merge 1 commit into
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: