diff --git a/main.go b/main.go index 6b72c83..3eb3322 100644 --- a/main.go +++ b/main.go @@ -332,7 +332,7 @@ func (h *editHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { pageText := mp.Get(page).Content - jsonEditor := pageText[0] == '{' + jsonEditor := pageText != "" && pageText[0] == '{' var editor template.HTML if jsonEditor { @@ -401,7 +401,7 @@ func (h *indexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } - jsonPage := pageText[0] == '{' + jsonPage := pageText != "" && pageText[0] == '{' if jsonPage { pageText, err = renderJSON(pageText)