From 9220ad23009de707cfb363ebb91a4a435be1337f Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Sat, 22 Jan 2011 13:21:20 +0000 Subject: [PATCH] (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. --- libtransmission/torrent.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 287ed5ba5..53642ee06 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -1455,15 +1455,12 @@ tr_torrentTrackersFree( tr_tracker_stat * trackers, int trackerCount ) 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