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

Fix reduce warning for empty arrays #203

Merged
merged 1 commit into from
Aug 11, 2019
Merged

Conversation

andreasvirkus
Copy link
Contributor

This fixes an error that gets thrown whenever frappe is fed an empty array for its datasets property.

The error reads:

Uncaught TypeError: Reduce of empty array with no initial value
    at Array.reduce (<anonymous>)
    at getClosestInArray (frappe-charts.esm.js:2671)
Steps To Test:
  • Initialise or call update on frappe-charts with datasets: []
TODOs:
  • Not sure. Are there any tests that should be modified or created to cover this behaviour?

@coveralls
Copy link

Pull Request Test Coverage Report for Build 72

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 38.158%

Totals Coverage Status
Change from base Build 71: 0.0%
Covered Lines: 29
Relevant Lines: 62

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 72

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 38.158%

Totals Coverage Status
Change from base Build 71: 0.0%
Covered Lines: 29
Relevant Lines: 62

💛 - Coveralls

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

3 participants