Skip to content

Commit

Permalink
Allow multiple calls to Publisher.Close without panic
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Jan 30, 2024
1 parent 720283f commit 5786367
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dagsync/ipnisync/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ func (p *Publisher) SetRoot(c cid.Cid) {
// Close closes the Publisher.
func (p *Publisher) Close() error {
if p.pubHost != nil {
return p.pubHost.Close()
err := p.pubHost.Close()
p.pubHost = nil
return err
}
return nil
}
Expand Down

0 comments on commit 5786367

Please sign in to comment.