diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js index b136d4cc21..7df8e3cea5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js @@ -24,20 +24,20 @@ angular.module("umbraco") }; $scope.setUrl = function(){ - + if($scope.control.value.image){ var url = $scope.control.value.image; - if($scope.control.editor.config.size){ + if($scope.control.editor.config && $scope.control.editor.config.size){ url += "?width=" + $scope.control.editor.config.size.width; url += "&height=" + $scope.control.editor.config.size.height; if($scope.control.value.focalPoint){ - url += "¢er=" + $scope.control.value.focalPoint.top +"," + $scope.control.value.focalPoint.left; + url += "¢er=" + $scope.control.value.focalPoint.top +"," + $scope.control.value.focalPoint.left; url += "&mode=crop"; } - } - + } + $scope.url = url; } }; @@ -47,4 +47,4 @@ angular.module("umbraco") $scope.setImage(); } }, 200); -}); \ No newline at end of file +});