mirror of
https://github.com/volatiletech/authboss.git
synced 2024-11-24 08:42:17 +02:00
Fix nil bug in responder
This commit is contained in:
parent
4aa961f758
commit
3c6c19e2e8
@ -27,6 +27,9 @@ func NewResponder(renderer authboss.Renderer) *Responder {
|
||||
func (r *Responder) Respond(w http.ResponseWriter, req *http.Request, code int, page string, data authboss.HTMLData) error {
|
||||
ctxData := req.Context().Value(authboss.CTXKeyData)
|
||||
if ctxData != nil {
|
||||
if data == nil {
|
||||
data = authboss.HTMLData{}
|
||||
}
|
||||
data.Merge(ctxData.(authboss.HTMLData))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user