Fix GetVAPIDKeyPair

This commit is contained in:
Vyr Cossont 2024-12-01 20:02:00 -08:00
parent 317e6ee7d5
commit a76556c866

View File

@ -42,11 +42,15 @@ func (w *webPushDB) GetVAPIDKeyPair(ctx context.Context) (*gtsmodel.VAPIDKeyPair
} }
// Look for previously generated keys in the database. // Look for previously generated keys in the database.
vapidKeyPair = &gtsmodel.VAPIDKeyPair{}
if err := w.db.NewSelect(). if err := w.db.NewSelect().
Model(vapidKeyPair). Model(vapidKeyPair).
Limit(1). Limit(1).
Scan(ctx); // nocollapse Scan(ctx); // nocollapse
err != nil && !errors.Is(err, db.ErrNoEntries) { err != nil {
if errors.Is(err, db.ErrNoEntries) {
return nil, nil
}
return nil, err return nil, err
} }