Skip to content

Commit

Permalink
Merge pull request #29 from erigontech/fix-info-nil
Browse files Browse the repository at this point in the history
Check info nil on NumPieces
  • Loading branch information
mh0lt authored Aug 27, 2024
2 parents 9848cb5 + 1933e04 commit e7832e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,11 @@ func (t *Torrent) numPieces(lock bool) pieceIndex {
t.imu.RLock()
defer t.imu.RUnlock()
}

if t.info == nil {
return 0
}

return t.info.NumPieces()
}

Expand Down

0 comments on commit e7832e6

Please sign in to comment.