diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index df2156a7f..e8bff23c1 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -1608,7 +1608,6 @@ peerCallbackFunc( tr_peer * peer, const tr_peer_event * e, void * vt ) torrentLock( t ); assert( peer != NULL ); - assert( peer->atom != NULL ); switch( e->eventType ) { @@ -1630,7 +1629,7 @@ peerCallbackFunc( tr_peer * peer, const tr_peer_event * e, void * vt ) tr_statsAddUploaded( tor->session, e->length ); /* update our atom */ - if( e->wasPieceData ) + if( peer->atom && e->wasPieceData ) peer->atom->piece_data_time = now; break; @@ -1671,7 +1670,8 @@ peerCallbackFunc( tr_peer * peer, const tr_peer_event * e, void * vt ) break; case TR_PEER_CLIENT_GOT_PORT: - peer->atom->port = e->port; + if( peer->atom ) + peer->atom->port = e->port; break; case TR_PEER_CLIENT_GOT_SUGGEST: @@ -1699,7 +1699,7 @@ peerCallbackFunc( tr_peer * peer, const tr_peer_event * e, void * vt ) tr_statsAddDownloaded( tor->session, e->length ); /* update our atom */ - if( e->wasPieceData ) + if( peer->atom && e->wasPieceData ) peer->atom->piece_data_time = now; break;