Catch a possible DivByZero error when moving folders around in fileview tab
This commit is contained in:
parent
053700342a
commit
ce636ccd57
|
@ -440,7 +440,11 @@ class FilesTab(Tab):
|
||||||
|
|
||||||
row = self.treestore.iter_next(row)
|
row = self.treestore.iter_next(row)
|
||||||
|
|
||||||
|
try:
|
||||||
value = (float(bytes) / float(self.treestore[parent][1])) * 100
|
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…
Reference in New Issue