From dd9ed8af74449bf7a8537ee61fd18a575a34960e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Wed, 3 Sep 2014 09:07:14 +0200 Subject: [PATCH] Fix bug test error code always being 1001 --- app/lib/phantomasWrapper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/lib/phantomasWrapper.js b/app/lib/phantomasWrapper.js index e9dd120..44728f7 100644 --- a/app/lib/phantomasWrapper.js +++ b/app/lib/phantomasWrapper.js @@ -77,13 +77,14 @@ var PhantomasWrapper = function() { console.log('Returning from Phantomas'); // Adding some YellowLabTools errors here - if (!json || !json.metrics || !json.metrics.javascriptExecutionTree) { + if (json && json.metrics && !json.metrics.javascriptExecutionTree) { err = 1001; } if (err) { console.log('Attempt failed for test id ' + task.testId + '. Error code ' + err); } + cb(err, {json: json, results: results}); }); }, function(err, data) {