You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/06/18 05:17:11 UTC

svn commit: r1494003 - /incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ParameterSelectCtrl.js

Author: joyce
Date: Tue Jun 18 03:17:11 2013
New Revision: 1494003

URL: http://svn.apache.org/r1494003
Log:
Resolve CLIMATE-118 - Remove undefined.split call in ParameterSelectCtrl

- Any call to someVariable.split first checks if the variable is
  undefined. If it is we return a dummy value instead of calling split.

Modified:
    incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ParameterSelectCtrl.js

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ParameterSelectCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ParameterSelectCtrl.js?rev=1494003&r1=1494002&r2=1494003&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ParameterSelectCtrl.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ParameterSelectCtrl.js Tue Jun 18 03:17:11 2013
@@ -242,16 +242,16 @@ function($rootScope, $scope, $http, $tim
 			$scope.displayParams.latMax = latMax;
 			$scope.displayParams.lonMin = lonMin;
 			$scope.displayParams.lonMax = lonMax;
-			$scope.displayParams.start = start.split(" ")[0];
-			$scope.displayParams.end = end.split(" ")[0];
+			$scope.displayParams.start = (typeof start == 'undefined') ? "" : start.split(" ")[0];
+			$scope.displayParams.end = (typeof end == 'undefined') ? "" : end.split(" ")[0];
 
 			// Update the local store values!
 			$scope.latMin = latMin;
 			$scope.latMax = latMax;
 			$scope.lonMin = lonMin;
 			$scope.lonMax = lonMax;
-			$scope.start = start.split(" ")[0];
-			$scope.end = end.split(" ")[0];
+			$scope.start = (typeof start == 'undefined') ? "" : start.split(" ")[0];
+			$scope.end = (typeof end == 'undefined') ? "" : end.split(" ")[0];
 
 			$scope.displayParams.areValid = true;
 			$rootScope.$broadcast('redrawOverlays', []);