Don't fall over on empty note title

This commit is contained in:
Maximilian Friedersdorff 2025-07-25 10:48:41 +01:00
parent 6f8796c83f
commit 0f2400435f

View file

@ -71,6 +71,10 @@ func edit(w http.ResponseWriter, r *http.Request) {
func new(w http.ResponseWriter, r *http.Request) {
title := r.FormValue("title")
if len(title) == 0 {
title = "<New Note>"
}
note := &notes.Note{Title: title}
urlEdit := myurls.Reverse("edit", urls.Repl{"note": note.EncodedTitle()})