diff --git a/guacamole/src/main/webapp/app/form/directives/form.js b/guacamole/src/main/webapp/app/form/directives/form.js index 8623e6f57..f22b9952b 100644 --- a/guacamole/src/main/webapp/app/form/directives/form.js +++ b/guacamole/src/main/webapp/app/form/directives/form.js @@ -104,6 +104,10 @@ angular.module('form').directive('guacForm', [function form() { */ $scope.getSectionHeader = function getSectionHeader(form) { + // If no form, or no name, then no header + if (!form || !form.name) + return ''; + return translationStringService.canonicalize($scope.namespace || 'MISSING_NAMESPACE') + '.SECTION_HEADER_' + translationStringService.canonicalize(form.name); @@ -128,6 +132,10 @@ angular.module('form').directive('guacForm', [function form() { */ $scope.getFieldHeader = function getFieldHeader(field) { + // If no field, or no name, then no header + if (!field || !field.name) + return ''; + return translationStringService.canonicalize($scope.namespace || 'MISSING_NAMESPACE') + '.FIELD_HEADER_' + translationStringService.canonicalize(field.name); diff --git a/guacamole/src/main/webapp/app/form/directives/formField.js b/guacamole/src/main/webapp/app/form/directives/formField.js index bf9b35434..60b440267 100644 --- a/guacamole/src/main/webapp/app/form/directives/formField.js +++ b/guacamole/src/main/webapp/app/form/directives/formField.js @@ -131,8 +131,8 @@ angular.module('form').directive('guacFormField', [function formField() { */ $scope.getFieldOption = function getFieldOption(value) { - // Don't bother if the model is not yet defined - if (!$scope.field) + // If no field, or no value, then no corresponding translation string + if (!$scope.field || !$scope.field.name || !value) return ''; return translationStringService.canonicalize($scope.namespace || 'MISSING_NAMESPACE')