Fixed error when adding a new entry.

This commit is contained in:
Alexis Lahouze 2013-01-24 14:58:09 +01:00
parent 48262fbcc8
commit a7e26e7d96
1 changed files with 3 additions and 1 deletions

View File

@ -179,7 +179,9 @@ var ListViewModel = function() {
// Transform to an array readable by jqplot Line renderer.
var chartValues = [];
$.each(entries, function(index, entry) {
chartValues.push([unwrap(entry.value_date), Number(unwrap(entry.sold))]);
if(entry.value_date && unwrap(entry.value_date)) {
chartValues.push([unwrap(entry.value_date), Number(unwrap(entry.sold))]);
}
});
return chartValues;