mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
fix null returned session (#159)
This commit is contained in:
@@ -47,18 +47,9 @@ func useSession(ctx context.Context, cfg *config.Config, sessionDB db.Session, e
|
||||
// check if we have a saved router session already
|
||||
rs, err := sessionDB.GetSession(ctx)
|
||||
if err != nil {
|
||||
if err != db.ErrNoEntries {
|
||||
// proper error occurred
|
||||
return err
|
||||
}
|
||||
// no session saved so create a new one
|
||||
rs, err = sessionDB.CreateSession(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return fmt.Errorf("error using session: %s", err)
|
||||
}
|
||||
|
||||
if rs == nil {
|
||||
if rs == nil || rs.Auth == nil || rs.Crypt == nil {
|
||||
return errors.New("router session was nil")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user