plot: prevent crash when there is only one point in array (issue #148)
This commit is contained in:
parent
e2be66f597
commit
03d5da9339
1 changed files with 2 additions and 0 deletions
|
|
@ -123,6 +123,8 @@ module.exports = class _plots_base extends Canvas {
|
|||
|
||||
}
|
||||
|
||||
if (points.length < 4) return
|
||||
|
||||
this.ctx.beginPath()
|
||||
|
||||
this.ctx.curve(points, this.smooth, Math.round(this.width/(points.length/2 - 1)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue