Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(lib/yukari.js): fix the bug: null is not equl to false(or 0, )
  • Loading branch information
mapleincode committed Mar 10, 2016
1 parent b599506 commit 6fd7c12
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/yukari.js
Expand Up @@ -426,6 +426,17 @@ Yukari.prototype.update = function(callback) {
fieldType.$equal.bind(fieldType) :
field.type.equal.bind(field.type));

// null not equal to false or 0 or ''
if((null === this[key] || null === this.$origData[key].data) &&
this[key] !== this.$origData[key].data &&
field.allowNull) {
data[field.name] = {
data : this[key],
field : field
};
continue;
}

// only change changed data
if(!equalFunc(this[key], this.$origData[key].data)) {
data[field.name] = {
Expand Down

0 comments on commit 6fd7c12

Please sign in to comment.