不要怂,就是干,撸起袖子干!

Commit c573b6e5 by Mick Hansen

Merge pull request #1881 from mohlman3/bugfix/undefined_set_date

Fix bug when setting a date field with undefined value
2 parents 04b95b74 c0bed722
Showing with 1 additions and 1 deletions
......@@ -298,7 +298,7 @@ module.exports = (function() {
}
// Convert date fields to real date objects
if (this.Model._hasDateAttributes && this.Model._isDateAttribute(key) && value !== null && !(value instanceof Date) && !value._isSequelizeMethod) {
if (this.Model._hasDateAttributes && this.Model._isDateAttribute(key) && value !== null && value !== undefined && !(value instanceof Date) && !value._isSequelizeMethod) {
value = new Date(value);
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!