mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 09:03:21 +00:00 
			
		
		
		
	GUAC-1053: Properly handle undefined form/field/option names.
This commit is contained in:
		| @@ -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); | ||||
|  | ||||
|   | ||||
| @@ -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') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user