diff --git a/src/common/libs/queue.js b/src/common/libs/queue.js index e08c6b0..c002b1f 100644 --- a/src/common/libs/queue.js +++ b/src/common/libs/queue.js @@ -66,7 +66,7 @@ Queue.prototype = { handler: function(fn, context) { this._runOrStore(function() { - fn.apply(context, this.getErrors()); + fn.apply(context, this.hasErrors()? this.getErrors() : [null]); }); return this; }, diff --git a/test/NormalizedCollection/Record.spec.js b/test/NormalizedCollection/Record.spec.js index 2357edd..592c6a2 100644 --- a/test/NormalizedCollection/Record.spec.js +++ b/test/NormalizedCollection/Record.spec.js @@ -432,7 +432,7 @@ describe('Record', function() { expect(spy).not.toHaveBeenCalled(); } }); - expect(spy).toHaveBeenCalledWith(); + expect(spy).toHaveBeenCalledWith(null); }); it('triggers callback with correct context', function() { @@ -450,7 +450,7 @@ describe('Record', function() { _.each(refs, function(ref) { try { ref.flush(); } catch(e) {} }); - expect(spy).toHaveBeenCalledWith(); + expect(spy).toHaveBeenCalledWith(null); }); it('returns an error if any path returns an error', function() {