From 1959921c5bf13ff8ae8d4a4075d2e8ebc2777604 Mon Sep 17 00:00:00 2001 From: Greg Mathews Date: Sun, 9 Sep 2018 12:10:47 -0700 Subject: [PATCH] Preventing an error when there were no legal tyres Previously I was an error on the server configuration page because I did not have any legal tyres in my configuration. This then prevented me from saving the page and changing the configuration. This check for undefined prevents the error. --- frontend/app/controllers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/app/controllers.js b/frontend/app/controllers.js index 246e83d..601ba89 100644 --- a/frontend/app/controllers.js +++ b/frontend/app/controllers.js @@ -193,7 +193,7 @@ angular.module('acServerManager') try { $scope.selectedCars = data.CARS.split(';'); $scope.selectedTracks = data.TRACK; //TODO: Multi-track - $scope.selectedTyres = data.LEGAL_TYRES.split(';'); + $scope.selectedTyres = typeof(data.LEGAL_TYRES) != "undefined" ? data.LEGAL_TYRES.split(';') : []; data.LOOP_MODE = data.LOOP_MODE == 1; data.LOCKED_ENTRY_LIST = data.LOCKED_ENTRY_LIST == 1; @@ -760,4 +760,4 @@ angular.module('acServerManager') } }) .controller('HelpCtrl', function($scope) { - }); \ No newline at end of file + });