prevent sending on closed channel for subscription.

This commit is contained in:
fiatjaf
2022-11-26 09:25:51 -03:00
parent 67d8f26d8a
commit 2d01aa8630
2 changed files with 14 additions and 7 deletions

View File

@@ -232,6 +232,7 @@ func (r *Relay) PrepareSubscription() *Subscription {
func (r *Relay) prepareSubscription(id string) *Subscription {
sub := &Subscription{
Relay: r,
conn: r.Connection,
id: id,
Events: make(chan Event),