mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 20:14:13 +00:00
Fix possible division by zero crash
This commit is contained in:
parent
c1622b23aa
commit
1209663595
@ -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…
x
Reference in New Issue
Block a user