downstream: fix panic in findWebPushSubscription for unbound conns
This code has been missed when adding webpush support for downstream connections without an upstream network bound.
This commit is contained in:
parent
3863b8cb6b
commit
de0992d41e
@ -3377,7 +3377,12 @@ func (dc *downstreamConn) handleNickServPRIVMSG(ctx context.Context, uc *upstrea
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (dc *downstreamConn) findWebPushSubscription(ctx context.Context, endpoint string) (*database.WebPushSubscription, error) {
|
func (dc *downstreamConn) findWebPushSubscription(ctx context.Context, endpoint string) (*database.WebPushSubscription, error) {
|
||||||
subs, err := dc.user.srv.db.ListWebPushSubscriptions(ctx, dc.network.ID)
|
var networkID int64
|
||||||
|
if dc.network != nil {
|
||||||
|
networkID = dc.network.ID
|
||||||
|
}
|
||||||
|
|
||||||
|
subs, err := dc.user.srv.db.ListWebPushSubscriptions(ctx, networkID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user