diff --git a/synced-pool.go b/synced-pool.go index 125fc21..60a8d53 100644 --- a/synced-pool.go +++ b/synced-pool.go @@ -266,7 +266,9 @@ func (p *SyncedPool) RemoveHost(host *RemoteHost) { defer p.mu.Unlock() h := p.remotes[host.Host] - h.Close() + if h != nil { + h.Close() + } delete(p.remotes, host.Host) connectedRemotes.Set(float64(len(p.remotes)))