From 151db97d21a3a470eccbf82abb47f4d5579d0bac Mon Sep 17 00:00:00 2001 From: Perception Date: Thu, 7 Jan 2021 11:14:37 -0800 Subject: [PATCH] Reorganize conditional to avoid crashes --- templates/_search.ejs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/_search.ejs b/templates/_search.ejs index ebfe804..72b1fbc 100644 --- a/templates/_search.ejs +++ b/templates/_search.ejs @@ -9,8 +9,10 @@
<% - let search = typeof q == 'undefined' ? '' : q; - search = htmlEscape(q).replace(/\+/g, ' ') + let search = '' + if (typeof q == 'undefined') { + search = htmlEscape(q).replace(/\+/g, ' ') + } %>