Workaround  for assert when search entry gets empty.

This isn't correct. Please fix me later.