Looks like tab can be NULL from the Mac client when magnet links are involved and the Mac client doesn't know how many pieces are available, so that assertion's not appropriate.
void
tr_torrentAvailability( const tr_torrent * tor, int8_t * tab, int size )
{
- assert( tr_isTorrent( tor ) );
- assert( tab != NULL );
- assert( size > 0 );
-
- tr_torrentLock( tor );
-
- tr_peerMgrTorrentAvailability( tor, tab, size );
-
- tr_torrentUnlock( tor );
+ if( tr_isTorrent( tor ) && ( tab != NULL ) && ( size > 0 ) )
+ {
+ tr_torrentLock( tor );
+ tr_peerMgrTorrentAvailability( tor, tab, size );
+ tr_torrentUnlock( tor );
+ }
}
void