Fix stacktrace dump on UI 'Seach' with empty string

Fix stacktrace dump on UI 'Seach' with empty string by expanding invalid search term conditional to filter out empty search term strings.  Also added unit tests for empty and null search terms.