Browse Source

Fix bug when there are no global variables

Gaël Métais 10 years ago
parent
commit
0083fcf0fc
1 changed files with 3 additions and 1 deletions
  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);
 
         // Sort globalVariables offenders alphabetically
-        $scope.phantomasResults.offenders.globalVariables.sort();
+        if ($scope.phantomasResults.offenders.globalVariables) {
+            $scope.phantomasResults.offenders.globalVariables.sort();
+        }
 
 
         initSummaryView();