You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the color picker property editor :
When the user remove the selection the model is set to null.
When the user tries to select another value after that, the condition is trying to check the "value" property for a null object. This cause the Javascript Error.
The user cannot save a new color selection
Simple fix : check for null in the condition in the onSelect method of the controller.
if ($scope.model.value.value === color) {
should be
if ($scope.model.value != null && $scope.model.value.value === color) {
Reproduction
Bug summary
See description
Specifics
* Any color picker property
* Umbraco 7.13.2
* Any browsers
Error logged in the console :
angular.min.js?cdv=296567087:63 TypeError: Cannot read property 'value' of null
at a.ColorPickerController.$scope.onSelect (umbraco.controllers.js?cdv=296567087:11606)
at angular.min.js?cdv=296567087:74
at Object.d.(/umbraco/anonymous function) [as onSelect] (https://etg.local.sigmund.ca/umbraco/lib/angular/1.1.5/angular.min.js?cdv=296567087:44:33)
at a.scope.setColor (umbraco.directives.js?cdv=296567087:8247)
at angular.min.js?cdv=296567087:74
at angular-mobile.js?cdv=296567087:270
at a.$eval (angular.min.js?cdv=296567087:92)
at a.$apply (angular.min.js?cdv=296567087:92)
at HTMLButtonElement.<anonymous> (angular-mobile.js?cdv=296567087:269)
at HTMLButtonElement.dispatch (jquery.min.js?cdv=296567087:3)
(anonymous) @ angular.min.js?cdv=296567087:63
Steps to reproduce
* Select a color
* Unselect the color
* Try to select a color
* The error is logged in the console
Expected result
* No Javascript error
* The user should be able to save a new color selection
Actual result
* The javascript error
* The user cannot save a new color selection
The text was updated successfully, but these errors were encountered:
Using the color picker property editor :
When the user remove the selection the model is set to null.
When the user tries to select another value after that, the condition is trying to check the "value" property for a null object. This cause the Javascript Error.
The user cannot save a new color selection
Simple fix : check for null in the condition in the onSelect method of the controller.
if ($scope.model.value.value === color) {
should be
if ($scope.model.value != null && $scope.model.value.value === color) {
Reproduction
Bug summary
See description
Specifics
Error logged in the console :
Steps to reproduce
Expected result
Actual result
The text was updated successfully, but these errors were encountered: