From 4eb5989c18c49a4c3150cc6a2ec55cc55d1bf4c2 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 8 Jun 2015 13:18:59 -0700 Subject: [PATCH] GUAC-1176: Ensure blank values are interpreted consistently (no multiple blank options in select fields). --- .../webapp/app/form/controllers/selectFieldController.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/guacamole/src/main/webapp/app/form/controllers/selectFieldController.js b/guacamole/src/main/webapp/app/form/controllers/selectFieldController.js index 593cc716b..f3af8d821 100644 --- a/guacamole/src/main/webapp/app/form/controllers/selectFieldController.js +++ b/guacamole/src/main/webapp/app/form/controllers/selectFieldController.js @@ -30,6 +30,12 @@ angular.module('form').controller('selectFieldController', ['$scope', '$injector // Required services var translationStringService = $injector.get('translationStringService'); + // Interpret undefined/null as empty string + $scope.$watch('model', function setModel(model) { + if (!model && model !== '') + $scope.model = ''; + }); + /** * Produces the translation string for the given field option * value. The translation string will be of the form: