1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00

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

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