]> granicus.if.org Git - transmission/commitdiff
(trunk libT) #3932 "Assertion failed: (tab != NULL), function tr_torrentAvailability"
authorJordan Lee <jordan@transmissionbt.com>
Sat, 22 Jan 2011 13:21:20 +0000 (13:21 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sat, 22 Jan 2011 13:21:20 +0000 (13:21 +0000)
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

index 287ed5ba5e9b65bbf70fc47cdde6e2619cc81f3c..53642ee06958b5a5d8dcc43f5ca3b3f26c1e1d93 100644 (file)
@@ -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