Factor out the repetition of the "no results" message. Fixes bug #973113.