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

This commit is contained in:
Penar Musaraj 2021-10-07 11:47:01 -04:00 committed by GitHub
parent 9f3b82eeb2
commit aa00960638
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,9 @@ export function addSearchSuggestion(value) {
class Highlighted extends RawHtml {
constructor(html, term) {
super({ html: `<span>${html}</span>` });
this.term = term.replace(TOPIC_REPLACE_REGEXP, "");
if (term) {
this.term = term.replace(TOPIC_REPLACE_REGEXP, "");
}
}
decorate($html) {