From 0083fcf0fc6b157f5f5f1d52dccc096c60fcd377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Thu, 23 Oct 2014 14:36:20 +0200 Subject: [PATCH] Fix bug when there are no global variables --- app/public/scripts/resultsCtrl.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/public/scripts/resultsCtrl.js b/app/public/scripts/resultsCtrl.js index 90cc637..f05ddfc 100644 --- a/app/public/scripts/resultsCtrl.js +++ b/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();