multixy: avoid error when points property is invalid (#685)

This commit is contained in:
bordun 2021-02-06 11:26:12 +01:00
parent b7765cee7d
commit bb5411dfab

View file

@ -49,8 +49,8 @@ module.exports = class MultiXy extends Pad {
super(options)
this.npoints = typeof this.getProp('points') == 'object' ? this.getProp('points').length : this.getProp('points')
this.labels = typeof this.getProp('points') == 'object'
this.npoints = Array.isArray(this.getProp('points')) ? this.getProp('points').length : this.getProp('points') || 0
this.labels = Array.isArray(this.getProp('points'))
this.pointSize = parseInt(this.getProp('pointSize'))
this.pads = []