fix: handle undefined data.query

This commit is contained in:
Barış Soner Uşaklı
2021-10-27 14:21:36 -04:00
parent 1e418f5b5e
commit 8f08d9cac0

View File

@@ -58,7 +58,7 @@ async function searchInContent(data) {
}
let pids = [];
let tids = [];
const inTopic = data.query.match(/^in:topic-([\d]+) /);
const inTopic = String(data.query || '').match(/^in:topic-([\d]+) /);
if (inTopic) {
const tid = inTopic[1];
const cleanedTerm = data.query.replace(inTopic[0], '');