Commit 552fc797 authored by Michael's avatar Michael

Merge pull request #14 from scivisum/fix_missing_data_crash

Return "empty array" rather than "null" if data is missing
parents bee6f09b 283a92bf
...@@ -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