Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
majestrate committed Aug 8, 2017
1 parent ef5df99 commit bbd38df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/xd/lib/bittorrent/swarm/torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ func (t *Torrent) handlePieces() {
// channel closed
return
}
if ev.r.Length > 0 {
if ev.r != nil && ev.r.Length > 0 {
log.Debugf("%s asked for piece %d %d-%d", ev.c.id.String(), ev.r.Index, ev.r.Begin, ev.r.Begin+ev.r.Length)
// TODO: cache common pieces (?)
err := t.st.VisitPiece(ev.r, func(p *common.PieceData) error {
Expand Down

0 comments on commit bbd38df

Please sign in to comment.