(trunk libT) #3932 "Assertion failed: (tab != NULL), function tr_torrentAvailability"

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.
This commit is contained in:
Jordan Lee 2011-01-22 13:21:20 +00:00
parent 2322b32591
commit 9220ad2300
1 changed files with 6 additions and 9 deletions

View File

@ -1455,16 +1455,13 @@ tr_torrentTrackersFree( tr_tracker_stat * trackers, int trackerCount )
void void
tr_torrentAvailability( const tr_torrent * tor, int8_t * tab, int size ) tr_torrentAvailability( const tr_torrent * tor, int8_t * tab, int size )
{ {
assert( tr_isTorrent( tor ) ); if( tr_isTorrent( tor ) && ( tab != NULL ) && ( size > 0 ) )
assert( tab != NULL ); {
assert( size > 0 );
tr_torrentLock( tor ); tr_torrentLock( tor );
tr_peerMgrTorrentAvailability( tor, tab, size ); tr_peerMgrTorrentAvailability( tor, tab, size );
tr_torrentUnlock( tor ); tr_torrentUnlock( tor );
} }
}
void void
tr_torrentAmountFinished( const tr_torrent * tor, tr_torrentAmountFinished( const tr_torrent * tor,