MySQL shouldn't break on null Date values

This commit is contained in:
Henri Bergius 2012-03-01 17:02:20 +02:00
parent 22a2b83382
commit 718cc2fa18
1 changed files with 1 additions and 1 deletions

View File

@ -130,7 +130,7 @@ MySQL.prototype.fromDatabase = function (model, data) {
Object.keys(data).forEach(function (key) {
var val = data[key];
if (props[key]) {
if (props[key].type.name === 'Date') {
if (props[key].type.name === 'Date' && val !== null) {
val = new Date(val.toString().replace(/GMT.*$/, 'GMT'));
}
}