fix crash on empty query

pull/4/head
cblgh 2021-02-03 21:59:04 +01:00
rodzic 65554d1864
commit af8c62fbbe
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -36,7 +36,7 @@ func searchRoute(res http.ResponseWriter, req *http.Request, config types.Config
if req.Method == http.MethodGet {
params := req.URL.Query()
words, exists := params["q"]
if !exists {
if !exists || words[0] == "" {
view := template.Must(template.ParseFiles("html/index-template.html"))
var empty interface{}
view.Execute(res, empty)