From 5dcb73521985aa7823144999570a7bb3278f44d2 Mon Sep 17 00:00:00 2001 From: mctep Date: Tue, 16 Apr 2013 16:24:18 +0400 Subject: [PATCH] If `result` is not an error then do `options.result` --- lib/de.block.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/de.block.js b/lib/de.block.js index d79c80b..ab4732a 100644 --- a/lib/de.block.js +++ b/lib/de.block.js @@ -279,8 +279,10 @@ de.Block.prototype.run = function(params, context) { options.after(params, context, result); } - if (options.result) { - result = new de.Result.Value( options.result( result.object(), context, params ) ); + if (!(result instanceof de.Result.Error)) { + if (options.result) { + result = new de.Result.Value( options.result( result.object(), context, params ) ); + } } if (options.template) {