torrentLock( t );
assert( peer != NULL );
- assert( peer->atom != NULL );
switch( e->eventType )
{
tr_statsAddUploaded( tor->session, e->length );
/* update our atom */
- if( e->wasPieceData )
+ if( peer->atom && e->wasPieceData )
peer->atom->piece_data_time = now;
break;
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:
tr_statsAddDownloaded( tor->session, e->length );
/* update our atom */
- if( e->wasPieceData )
+ if( peer->atom && e->wasPieceData )
peer->atom->piece_data_time = now;
break;