Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Resolve reduce of empty array with no initial val #1664

Closed
wants to merge 1 commit into from

Conversation

0x19
Copy link

@0x19 0x19 commented Oct 5, 2015

In case that there are no projects in jira it will start displaying error bellow due to array being empty and no initial value for reduce.

[Mon Oct 05 2015 03:03:21 GMT-0400 (EDT)] ERROR TypeError: Reduce of empty array with no initial value
at Array.reduce (native)
at /usr/local/xxx/node_modules/hubot-scripts/src/scripts/jira-issues.coffee:42:7, :27:38
at IncomingMessage. (/usr/local/xxx/node_modules/hubot/node_modules/scoped-http-client/src/index.js:95:22)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:448:13)

In case that there are no projects in jira it will start displaying error bellow due to array being empty and no initial value for reduce.

[Mon Oct 05 2015 03:03:21 GMT-0400 (EDT)] ERROR TypeError: Reduce of empty array with no initial value
  at Array.reduce (native)
  at /usr/local/xxx/node_modules/hubot-scripts/src/scripts/jira-issues.coffee:42:7, <js>:27:38
  at IncomingMessage.<anonymous> (/usr/local/bender/node_modules/hubot/node_modules/scoped-http-client/src/index.js:95:22)
  at IncomingMessage.emit (events.js:117:20)
  at _stream_readable.js:944:16
  at process._tickCallback (node.js:448:13)
@technicalpickles
Copy link
Contributor

This repository has been deprecated for awhile in favor of npm packages, and it looks like this one was extracted to https://github.com/rustedgrail/hubot-jira. We are in the process of finding scripts that have been extracted, and deprecating them over in #1641, so I'd give that a try to see if it works any better.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants