浏览代码

Fix bug test error code always being 1001

Gaël Métais 11 年之前
父节点
当前提交
dd9ed8af74
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/lib/phantomasWrapper.js

+ 2 - 1
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) {