Reorganize conditional to avoid crashes

This commit is contained in:
2021-01-07 11:14:37 -08:00
parent 6354a6b7e8
commit 151db97d21
+4 -2
View File
@@ -9,8 +9,10 @@
<form method="GET" action="/search" >
<div class="eight columns" >
<%
let search = typeof q == 'undefined' ? '' : q;
search = htmlEscape(q).replace(/\+/g, ' ')
let search = ''
if (typeof q == 'undefined') {
search = htmlEscape(q).replace(/\+/g, ' ')
}
%>
<input type="text" name="q" value="<%- search %>" class="u-full-width" />
</div>