MySQL shouldn't break on null Date values
This commit is contained in:
parent
22a2b83382
commit
718cc2fa18
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue