Don't fall over on empty note title
This commit is contained in:
parent
6f8796c83f
commit
0f2400435f
1 changed files with 4 additions and 0 deletions
|
|
@ -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 := ¬es.Note{Title: title}
|
||||
|
||||
urlEdit := myurls.Reverse("edit", urls.Repl{"note": note.EncodedTitle()})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue