Explorar o código

Fix bug when there are no global variables

Gaël Métais %!s(int64=10) %!d(string=hai) anos
pai
achega
0083fcf0fc
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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();