Skip to content

Commit d5fa606

Browse files
committed
fix: JS null pointer error on Doctum.cleanSearchQuery
1 parent 640e6af commit d5fa606

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Resources/themes/default/doctum.js.twig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,13 @@ var Doctum = {
282282
/**
283283
* Clean the search query
284284
*
285-
* @param string query
285+
* @param string|null query
286286
* @return string
287287
*/
288288
cleanSearchQuery: function (query) {
289+
if (typeof query !== 'string') {
290+
return '';
291+
}
289292
// replace any chars that could lead to injecting code in our regex
290293
// remove start or end spaces
291294
// replace backslashes by an escaped version, use case in search: \myRootFunction

0 commit comments

Comments
 (0)