FIX: JS error when showing topic search results (PR #14551)

The search-result-topic widget is used in the composer, when displaying similar topics based on the inputted title. But in that context, we don’t have a search term, and that was causing the similar topics box to be empty and output a console error.

See also: Your topic is similar to...popup is empty - bug - Discourse Meta

Bug was initially introduced in UX: Revamp quick search (#14499) · discourse/discourse@e9b1d29 · GitHub


This pull request has been mentioned on Discourse Meta. There might be relevant details there: