diff --git a/awx/ui/client/src/shared/smart-search/smart-search.controller.js b/awx/ui/client/src/shared/smart-search/smart-search.controller.js index 5d60842674..22a91ec61a 100644 --- a/awx/ui/client/src/shared/smart-search/smart-search.controller.js +++ b/awx/ui/client/src/shared/smart-search/smart-search.controller.js @@ -201,7 +201,7 @@ export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', ' origQueryset = _.clone(queryset); // Remove leading/trailing whitespace if there is any - terms = terms.trim(); + terms = (terms) ? terms.trim() : ""; if(terms && terms !== '') { // Split the terms up