mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +00:00
Fix possible division by zero crash
This commit is contained in:
parent
c1622b23aa
commit
1209663595
1 changed files with 4 additions and 1 deletions
|
@ -371,7 +371,10 @@ class Torrent:
|
|||
file_progress = self.handle.file_progress()
|
||||
ret = []
|
||||
for i,f in enumerate(self.files):
|
||||
ret.append(float(file_progress[i]) / float(f["size"]))
|
||||
try:
|
||||
ret.append(float(file_progress[i]) / float(f["size"]))
|
||||
except ZeroDivisionError:
|
||||
ret.append(0.0)
|
||||
|
||||
return ret
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue