Don't return NaN from Torrent::percentComplete (Qt client)

This commit is contained in:
Mike Gelfand 2017-05-01 12:55:29 +03:00
parent c5e730c63a
commit f1656bc209
1 changed files with 1 additions and 1 deletions

View File

@ -314,7 +314,7 @@ public:
double percentComplete() const
{
return haveTotal() / static_cast<double>(totalSize());
return totalSize() != 0 ? haveTotal() / static_cast<double>(totalSize()) : 0;
}
double percentDone() const