diff --git a/router.go b/router.go index b83128d..c55e222 100644 --- a/router.go +++ b/router.go @@ -53,6 +53,7 @@ func (a *appData) buildRouter() http.Handler { err = enc.Encode(albums) if err != nil { narco.Error(ctx, w, err, http.StatusInternalServerError) + return } }))) @@ -73,6 +74,7 @@ func (a *appData) buildRouter() http.Handler { albumUnsafe, err := a.db.Get(AlbumID(id)) if err != nil { narco.Error(ctx, w, err, http.StatusInternalServerError) + return } album := *albumUnsafe @@ -81,6 +83,7 @@ func (a *appData) buildRouter() http.Handler { enc := json.NewEncoder(w) if err := enc.Encode(album); err != nil { narco.Error(ctx, w, err, http.StatusInternalServerError) + return } })))