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

Prevent undefined response throwing errors during Array.prototype.slice #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tannerhodges
Copy link

Hey @Schinkentanz, thanks for putting Daily Git together.

On my first pass, I got this error:

/Users/tannerhodges/.nvm/versions/node/v6.10.3/lib/node_modules/daily-git/src/index.js:95
      var commits = Array.prototype.slice.call(body);
                                          ^

TypeError: Array.prototype.slice called on null or undefined

Some of my repos return empty responses (assuming that's because I either haven't committed anything recently, or because I triggered GitHub's rate limit).

To fix, I added an empty array fallback for cases where body is undefined.

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

Successfully merging this pull request may close these issues.

None yet

1 participant