Skip to content

Commit

Permalink
check info nil
Browse files Browse the repository at this point in the history
  • Loading branch information
mh0lt committed Aug 27, 2024
1 parent 9848cb5 commit 1933e04
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 1933e04

Please sign in to comment.