jakecraige / github-unwatch-org-repos

A utility for unwatching all of an organization's repos
6 stars 2 forks source link

Uncaught TypeError #2

Open steelbrain opened 9 years ago

steelbrain commented 9 years ago
Finding all steelbrain's watched repos. This may take awhile.
steelbrain is currently watching 103 repos.
Finding all AtomLinter's repos. This may take awhile.
/steel/Local/iojs/lib/node_modules/github-unwatch-org-repos/index.js:91
  return link.next && link.next.page;
             ^
TypeError: Cannot read property 'next' of null
    at hasNextPage (/steel/Local/iojs/lib/node_modules/github-unwatch-org-repos/index.js:91:14)
    at /steel/Local/iojs/lib/node_modules/github-unwatch-org-repos/index.js:106:20
    at /steel/Local/iojs/lib/node_modules/github-unwatch-org-repos/node_modules/octonode/lib/octonode/org.js:56:18
    at Client.errorHandle (/steel/Local/iojs/lib/node_modules/github-unwatch-org-repos/node_modules/octonode/lib/octonode/client.js:183:14)
    at Request._callback (/steel/Local/iojs/lib/node_modules/github-unwatch-org-repos/node_modules/octonode/lib/octonode/client.js:197:24)
    at Request.self.callback (/steel/Local/iojs/lib/node_modules/github-unwatch-org-repos/node_modules/octonode/node_modules/request/request.js:373:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/steel/Local/iojs/lib/node_modules/github-unwatch-org-repos/node_modules/octonode/node_modules/request/request.js:1318:14)
    at emitOne (events.js:82:20)
steelbrain commented 9 years ago

Note: Changing link.next && link.next.page to link && link.next && link.next.page fixed this problem.