Skip to content

Commit 5246521

Browse files
committed
fix #180
1 parent 754db47 commit 5246521

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/collection.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ SkinCollection.prototype.updateById = function (id, doc, callback) {
155155
var _this = this;
156156
if (callback) {
157157
callback = function(error, res) {
158-
oldCb.call(_this, error, res.result);
158+
oldCb.call(_this, error, !!res ? res.result : null);
159159
};
160160
}
161161
return this._operateById('update', id, [id, doc, callback]);
@@ -173,7 +173,7 @@ SkinCollection.prototype.removeById = function (id, callback) {
173173
var _this = this;
174174
if (callback) {
175175
callback = function(error, res) {
176-
oldCb.call(_this, error, res.result.n);
176+
oldCb.call(_this, error, !!res ? res.result.n : null);
177177
};
178178
}
179179
return this._operateById('remove', id, [id, callback]);

0 commit comments

Comments
 (0)