fix: check if session exists for see other
This commit is contained in:
parent
dd952a1f39
commit
ffd3890584
|
|
@ -29,11 +29,13 @@ func (res *Response) Write(w http.ResponseWriter, r *http.Request) error {
|
|||
|
||||
if res.SeeOther != "" {
|
||||
http.Redirect(w, r, res.SeeOther, http.StatusSeeOther)
|
||||
flash := res.Session.FlashPeek()
|
||||
if flash != nil {
|
||||
err := json.NewEncoder(w).Encode(flash)
|
||||
if err != nil {
|
||||
return err
|
||||
if res.Session != nil {
|
||||
flash := res.Session.FlashPeek()
|
||||
if flash != nil {
|
||||
err := json.NewEncoder(w).Encode(flash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue