diff --git a/appServer.go b/appServer.go index ee71774..dbea571 100644 --- a/appServer.go +++ b/appServer.go @@ -106,12 +106,12 @@ func (app *application) ServeHTTP(w http.ResponseWriter, req *http.Request) { } switch req.Method { - case "POST": + case http.MethodPost: if req.URL.Path == "/" { app.postHandler(w, req) } - case "GET": + case http.MethodGet: switch req.URL.Path { case "/": w.WriteHeader(http.StatusOK) diff --git a/listLayout.go b/listLayout.go index 72c1e80..2481a30 100644 --- a/listLayout.go +++ b/listLayout.go @@ -67,7 +67,6 @@ func (listLayout *listLayoutData) init(session Session) { listLayout.set = listLayout.setFunc listLayout.remove = listLayout.removeFunc listLayout.changed = listLayout.propertyChanged - } func normalizeListLayoutTag(tag PropertyName) PropertyName { @@ -115,9 +114,12 @@ func (listLayout *listLayoutData) removeFunc(tag PropertyName) []PropertyName { return result case Content: - listLayout.viewsContainerData.removeFunc(Content) - listLayout.adapter = nil - return []PropertyName{Content} + result := listLayout.viewsContainerData.removeFunc(Content) + if listLayout.adapter != nil { + listLayout.adapter = nil + return []PropertyName{Content} + } + return result } return listLayout.viewsContainerData.removeFunc(tag)