Skip to content

Commit 66185fd

Browse files
Merge pull request #10 from canallc/master
Ensure date is not null when reading from database
2 parents d183cdc + 7294b1e commit 66185fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/sqlite3db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ SQLiteDB.prototype.fromDatabase = function (model, data) {
424424
} else {
425425
json[p] = val;
426426
}
427-
} else if (prop && type === 'Date'){
427+
} else if (prop && (type === 'Date') && (val !== null)) {
428428
json[p] = new Date(val);
429429
} else {
430430
json[p] = val;

0 commit comments

Comments
 (0)