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

command is not working and throws TypeError: Cannot read property 'firstChild' of undefined #3

Open
Hakier opened this issue Dec 11, 2018 · 1 comment

Comments

@Hakier
Copy link

Hakier commented Dec 11, 2018

review.js https://github.com/shelljs/shx/pull/14

https://github.com/shelljs/shx/pull/14
URL successfully fetched
Setup tests by levithomason · Pull Request #14 · shelljs/shx · GitHub
ERROR: null
/home/hakier/.npm-packages/lib/node_modules/github-review/review.js:75
    branch_name = nodes[1].firstChild.data.trim();
                           ^

TypeError: Cannot read property 'firstChild' of undefined
    at Object.<anonymous> (/home/hakier/.npm-packages/lib/node_modules/github-review/review.js:75:28)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)```
@nfischer
Copy link
Owner

Thanks for trying this out! I can indeed repro this locally.

The PR you're referring to (shelljs/shx#14) refers to a fork which no longer exists. I never handled this edge case.

That said, I don't think this script could do anything useful (except it might fail with a clearer error message). This isn't very common for my use-case, because I would use it to review active PRs.

I'll gladly review a PR to improve this edge case.

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

No branches or pull requests

2 participants