From f1656bc2096f650b2441e9abc3d6609d535c61d4 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Mon, 1 May 2017 12:55:29 +0300 Subject: [PATCH] Don't return NaN from Torrent::percentComplete (Qt client) --- qt/Torrent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/Torrent.h b/qt/Torrent.h index 84e2ad8c9..cd4cc0902 100644 --- a/qt/Torrent.h +++ b/qt/Torrent.h @@ -314,7 +314,7 @@ public: double percentComplete() const { - return haveTotal() / static_cast(totalSize()); + return totalSize() != 0 ? haveTotal() / static_cast(totalSize()) : 0; } double percentDone() const