Fix error when opening menu if file size is null
This commit is contained in:
parent
8edbcb7a6c
commit
c59bc0cb3a
1 changed files with 4 additions and 1 deletions
|
@ -144,7 +144,10 @@ class UiWebsocketPlugin(object):
|
||||||
else:
|
else:
|
||||||
size = size_filetypes.get(extension, 0)
|
size = size_filetypes.get(extension, 0)
|
||||||
size_other -= size
|
size_other -= size
|
||||||
percent = 100 * (float(size) / size_total)
|
if size_total == 0:
|
||||||
|
percent = 0
|
||||||
|
else:
|
||||||
|
percent = 100 * (float(size) / size_total)
|
||||||
body.append(u"<li style='width: %.2f%%' class='%s back-%s' title='%s'></li>" % (percent, extension, color, extension))
|
body.append(u"<li style='width: %.2f%%' class='%s back-%s' title='%s'></li>" % (percent, extension, color, extension))
|
||||||
|
|
||||||
# Legend
|
# Legend
|
||||||
|
|
Loading…
Reference in a new issue