From 1e5b3fbe31f21dbf529be4d4dd6f769bb22ec4e1 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Mon, 9 Jan 2017 16:43:02 -0500 Subject: [PATCH] handle undefined (empty) ec2 variable textarea * Adding a check for undefined, null check was not enough. applyDefaults() is only called in 'add' mode. This method is responsible for settings the fields value to the passed in 'default'. Since applyDefaults() isn't called in 'edit' mode, the field has a value of undefined. --- .../src/inventories/manage/groups/groups-edit.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/inventories/manage/groups/groups-edit.controller.js b/awx/ui/client/src/inventories/manage/groups/groups-edit.controller.js index 1b54bc92f1..ae90cae8bf 100644 --- a/awx/ui/client/src/inventories/manage/groups/groups-edit.controller.js +++ b/awx/ui/client/src/inventories/manage/groups/groups-edit.controller.js @@ -123,7 +123,7 @@ export default ['$state', '$stateParams', '$scope', 'ToggleNotification', 'Parse $scope.source = source; if (source.value === 'ec2' || source.value === 'custom' || source.value === 'vmware' || source.value === 'openstack') { - $scope[source.value + '_variables'] = $scope[source.value + '_variables'] === null ? '---' : $scope[source.value + '_variables']; + $scope[source.value + '_variables'] = $scope[source.value + '_variables'] === (null || undefined) ? '---' : $scope[source.value + '_variables']; ParseTypeChange({ scope: $scope, field_id: source.value + '_variables',