浏览代码

Fix bug when there are no global variables

Gaël Métais 10 年之前
父节点
当前提交
0083fcf0fc
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/public/scripts/resultsCtrl.js

+ 3 - 1
app/public/scripts/resultsCtrl.js

@@ -13,7 +13,9 @@ app.controller('ResultsCtrl', function ($scope) {
         $scope.javascript = JSON.parse($scope.phantomasResults.offenders.javascriptExecutionTree);
         $scope.javascript = JSON.parse($scope.phantomasResults.offenders.javascriptExecutionTree);
 
 
         // Sort globalVariables offenders alphabetically
         // Sort globalVariables offenders alphabetically
-        $scope.phantomasResults.offenders.globalVariables.sort();
+        if ($scope.phantomasResults.offenders.globalVariables) {
+            $scope.phantomasResults.offenders.globalVariables.sort();
+        }
 
 
 
 
         initSummaryView();
         initSummaryView();