From 74bfaabf90b505a088e657b49f82ea2be83e4903 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 3 Apr 2019 13:35:01 +0200 Subject: [PATCH] Added null-check before updating the count. (#5142) --- .../src/views/propertyeditors/textbox/textbox.controller.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js index 4ab827db59..32e9891eb4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js @@ -4,7 +4,7 @@ function textboxController($scope) { if (!$scope.model.config) { $scope.model.config = {}; } - + $scope.model.count = 0; if (!$scope.model.config.maxChars) { // 500 is the maximum number that can be stored // in the database, so set it to the max, even @@ -13,7 +13,9 @@ function textboxController($scope) { } $scope.model.change = function () { - $scope.model.count = $scope.model.value.length; + if ($scope.model.value) { + $scope.model.count = $scope.model.value.length; + } } $scope.model.change();