diff --git a/torrent.go b/torrent.go index 40e849b221..a5de99cd04 100644 --- a/torrent.go +++ b/torrent.go @@ -2857,10 +2857,13 @@ func (t *Torrent) tryCreatePieceHasher(lock bool) bool { }) t.mu.RLock() - if hashResults := t.hashResults; hashResults != nil { - hashResults <- hashResult{p.index, correct, failedPeers, copyErr} - } + hashResults := t.hashResults t.mu.RUnlock() + + select { + case hashResults <- hashResult{p.index, correct, failedPeers, copyErr}: + case <-t.closed.Done(): + } } }()