Skip to content

Commit

Permalink
fix: provide initial value to avoid reducing empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryptkeeper committed Jun 7, 2021
1 parent af23014 commit 0f297b7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions assets/js/scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class RelativeScale {
// https://stackoverflow.com/questions/63705432/maximum-call-stack-size-exceeded-when-using-the-dots-operator/63706516#63706516
const max = nonNullData.reduce((a, b) => {
return Math.max(a, b)
})
}, 0)

return RelativeScale.scale(
[0, RelativeScale.isFiniteOrZero(max)],
Expand Down Expand Up @@ -70,10 +70,10 @@ export class RelativeScale {
// https://stackoverflow.com/questions/63705432/maximum-call-stack-size-exceeded-when-using-the-dots-operator/63706516#63706516
const min = nonNullData.reduce((a, b) => {
return Math.min(a, b)
})
}, 0)
const max = nonNullData.reduce((a, b) => {
return Math.max(a, b)
})
}, 0)

return {
min: RelativeScale.isFiniteOrZero(min),
Expand Down
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**5.6.0** *(June 7 2021)*
- Fixed a regression caused by rendering error fixed in 5.5.9. See https://github.com/Cryptkeeper/Minetrack/issues/257

**5.5.9** *(May 31 2021)*
- Added configuration option to enable/disable ping failure logging.
- Fixed a rendering error when the primary historical graph has too many data points.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minetrack",
"version": "5.5.9",
"version": "5.6.0",
"description": "A Minecraft server tracker that lets you focus on the basics.",
"dependencies": {
"finalhandler": "^1.1.2",
Expand Down

0 comments on commit 0f297b7

Please sign in to comment.