diff --git a/lib/remote-objects.js b/lib/remote-objects.js index a4350704..236ba1dd 100644 --- a/lib/remote-objects.js +++ b/lib/remote-objects.js @@ -677,7 +677,12 @@ RemoteObjects.prototype.invokeMethodInContext = function(ctx, method, cb) { 'Pass the method as ctx.method instead.'); } - self.phases.run(ctx, triggerErrorAndCallBack); + self.phases.run(ctx, testIfErrorAndCallBack); + + function testIfErrorAndCallBack(err) { + if (err) return triggerErrorAndCallBack(err); + cb(); + } function triggerErrorAndCallBack(err) { ctx.error = err;