Fix stacktrace dump on UI 'Seach' with empty string by expanding invalid search term conditional to filter out empty search term strings

Resolves: https://www.pivotaltracker.com/story/show/62938136