mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-05 16:08:40 +00:00
Catch a possible DivByZero error when moving folders around in fileview tab
This commit is contained in:
parent
2c615e468b
commit
ca0003a7af
1 changed files with 5 additions and 1 deletions
|
@ -437,7 +437,11 @@ class FilesTab(Tab):
|
||||||
|
|
||||||
row = self.treestore.iter_next(row)
|
row = self.treestore.iter_next(row)
|
||||||
|
|
||||||
value = (float(bytes) / float(self.treestore[parent][1])) * 100
|
try:
|
||||||
|
value = (float(bytes) / float(self.treestore[parent][1])) * 100
|
||||||
|
except ZeroDivisionError:
|
||||||
|
# Catch the unusal error found when moving folders around
|
||||||
|
value = 0
|
||||||
self.treestore[parent][3] = value
|
self.treestore[parent][3] = value
|
||||||
self.treestore[parent][2] = "%.2f%%" % value
|
self.treestore[parent][2] = "%.2f%%" % value
|
||||||
return bytes
|
return bytes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue