fix: prevent nil pointer when err session retrieval fails
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
see https://sentry.in.nuonet.fr/share/issue/48b82c13ee3f4721bb6306b533799709/
This commit is contained in:
parent
7cc9de180c
commit
ce7415af20
@ -64,13 +64,14 @@ func (s *Store) New(r *http.Request, name string) (*sessions.Session, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return session, nil
|
return session, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
session.ID = c.Value
|
session.ID = c.Value
|
||||||
|
|
||||||
err = s.load(r.Context(), session)
|
err = s.load(r.Context(), session)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
session.IsNew = false
|
session.IsNew = false
|
||||||
} else if !errors.Is(err, ErrNotFound) {
|
} else if !errors.Is(err, ErrNotFound) {
|
||||||
return nil, errors.WithStack(err)
|
return session, errors.WithStack(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return session, nil
|
return session, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user