Commit 283a92bf authored by Shish Girling's avatar Shish Girling

Return "empty array" rather than "null" if data is missing

"series.datapoints.points = null" can cause other parts of flot to crash
parent bee6f09b
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
for (var i = 1; i < n - 1; ++i) { for (var i = 1; i < n - 1; ++i) {
var d = (xdata[i + 1] - xdata[i - 1]); var d = (xdata[i + 1] - xdata[i - 1]);
if (d == 0) { if (d == 0) {
return null; return [];
} }
var s = (xdata[i] - xdata[i - 1]) / d; var s = (xdata[i] - xdata[i - 1]) / d;
...@@ -334,7 +334,7 @@ ...@@ -334,7 +334,7 @@
var h = (xdata[max] - xdata[min]); var h = (xdata[max] - xdata[min]);
if (h == 0) { if (h == 0) {
return null; return [];
} }
var a = (xdata[max] - xnew[j]) / h; var a = (xdata[max] - xnew[j]) / h;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment