Skip to content

Commit 194f265

Browse files
author
Mr. X
committed
more error handling
1 parent 28a141c commit 194f265

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/renderers/RealLineGraph.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ class RealLineGraph extends RealRenderer {
4141
}
4242

4343
addData(value) {
44-
if (typeof value != 'number') throw 'Data value not a number.'
44+
value = parseFloat(value);
45+
46+
if (isNaN(value)) throw 'Data value not a number.'
4547

4648
this.graphPixels = this._addData(this._cloneTexture(this.graphPixels), value, this._dataIndex++, this._lastData, this._numProgress);
4749
this._lastData = value;

0 commit comments

Comments
 (0)