From 56fa51d69cf774aed67d8ec306f3ecae0c382f60 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Thu, 6 Feb 2025 12:22:11 -0800 Subject: [PATCH] Do not throw error if ratio not specified in url Previously this was throwing an error when ratio was not specified in url, because then ratio would be undefined and string related methods could not be called on it. --- src/js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/app.js b/src/js/app.js index 53f59d0..eb2ff3d 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -333,7 +333,7 @@ controller('AppCtrl', ['$scope', '$http', '$timeout', '$q', '$window', '$httpPar } $scope.crop_dim = crop_dim; - if ($scope.currentUrlParams.ratio !== '' && $scope.currentUrlParams.ratio.split(':').length == 2) { + if (typeof $scope.currentUrlParams.ratio === 'string' && $scope.currentUrlParams.ratio !== '' && $scope.currentUrlParams.ratio.split(':').length == 2) { var parts = $scope.currentUrlParams.ratio.split(':'); $scope.aspectratio = 'fixed'; $scope.aspectratio_cx = parts[0];