diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index e3539e4b64..36b0b65327 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -120,7 +120,11 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Hos elm.removeAttr('required'); if ($(elm).hasClass('lookup')) { var txt = $(elm).parent().parent().parent().find('label').text(); - $(elm).parent().parent().parent().find('label').text(txt.replace(/^*/,'')); + var txt = txt.replace(/^\*/,''); + var label = $(elm).parent().parent().parent().find('label'); + if (label) { + label.text(txt); + } } } if (scope[attrs.awRequiredWhen] && (viewValue == undefined || viewValue == null || viewValue == '')) {