Skip to content

Commit ee2587e

Browse files
committed
Don't throw away data on user error.
If then() returns no data/undefined, don't throw the current data away.
1 parent 7a0d3c0 commit ee2587e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/thread.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@
192192
var that = this;
193193
var newOp = new Operation();
194194
this.operation.then(function () {
195-
that.data = cb(that.data);
195+
var retData = cb(that.data);
196+
if (retData !== undefined) {
197+
that.data = retData;
198+
}
196199
newOp.resolve(null, that.data);
197200
}, errCb);
198201
this.operation = newOp;

0 commit comments

Comments
 (0)