diff --git a/torrent.go b/torrent.go index 48c7fab6a0..7d047bdd1a 100644 --- a/torrent.go +++ b/torrent.go @@ -2856,7 +2856,13 @@ func (t *Torrent) tryCreatePieceHasher(lock bool) bool { cs.pieceHashed(length) }) - t.hashResults <- hashResult{p.index, correct, failedPeers, copyErr} + t.mu.RLock() + hashResults := t.hashResults + t.mu.RUnlock() + + if hashResults != nil { + hashResults <- hashResult{p.index, correct, failedPeers, copyErr} + } } }()