From: Charles Kerr Date: Wed, 8 Dec 2010 15:45:43 +0000 (+0000) Subject: (trunk qt) #3814 "Crash when opening properties dialog on a torrent before all its... X-Git-Tag: 2.13~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ec0a4dd269c4c34f5a33cd2a057eff363f5c6f47;p=transmission (trunk qt) #3814 "Crash when opening properties dialog on a torrent before all its stats have been fetched" -- fixed. --- diff --git a/qt/details.cc b/qt/details.cc index cf9a9cb05..a1403ae21 100644 --- a/qt/details.cc +++ b/qt/details.cc @@ -366,7 +366,8 @@ Details :: refresh( ) haveUnverified += t->haveUnverified( ); const uint64_t v = t->haveVerified( ); haveVerified += v; - verifiedPieces += v / t->pieceSize( ); + if( t->pieceSize( ) ) + verifiedPieces += v / t->pieceSize( ); sizeWhenDone += t->sizeWhenDone( ); leftUntilDone += t->leftUntilDone( ); available += t->sizeWhenDone() - t->leftUntilDone() + t->desiredAvailable(); diff --git a/qt/torrent.cc b/qt/torrent.cc index 4a3f26cc3..5aa941904 100644 --- a/qt/torrent.cc +++ b/qt/torrent.cc @@ -537,8 +537,7 @@ Torrent :: update( tr_benc * d ) if( tr_bencDictFindList( d, "fileStats", &files ) ) { const int n = tr_bencListSize( files ); - assert( n == myFiles.size( ) ); - for( int i=0; i