diff --git a/support/response.go b/support/response.go index acbc7e5..8bd593d 100644 --- a/support/response.go +++ b/support/response.go @@ -35,12 +35,17 @@ var wsUpgrader = websocket.Upgrader{ } func (this HttpStatusResponse) Get(path ...string) req.GlobalParams { + if this.body == nil { + return req.NewGlobalParam("", nil) + } return this.body.Get(path...) } func (this HttpStatusResponse) Send(w http.ResponseWriter, r *http.Request) { w.WriteHeader(this.status) - this.body.Send(w, r) + if this.body != nil { + this.body.Send(w, r) + } } func (this RawResponse) Get(path ...string) req.GlobalParams {