mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: handle undefined data.query
This commit is contained in:
@@ -58,7 +58,7 @@ async function searchInContent(data) {
|
|||||||
}
|
}
|
||||||
let pids = [];
|
let pids = [];
|
||||||
let tids = [];
|
let tids = [];
|
||||||
const inTopic = data.query.match(/^in:topic-([\d]+) /);
|
const inTopic = String(data.query || '').match(/^in:topic-([\d]+) /);
|
||||||
if (inTopic) {
|
if (inTopic) {
|
||||||
const tid = inTopic[1];
|
const tid = inTopic[1];
|
||||||
const cleanedTerm = data.query.replace(inTopic[0], '');
|
const cleanedTerm = data.query.replace(inTopic[0], '');
|
||||||
|
|||||||
Reference in New Issue
Block a user