From c59bc0cb3a97c1afaffb62dc18a5ec7033e0c918 Mon Sep 17 00:00:00 2001 From: TheNain38 Date: Fri, 15 Jan 2016 19:50:02 +0100 Subject: [PATCH] Fix error when opening menu if file size is null --- plugins/Sidebar/SidebarPlugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Sidebar/SidebarPlugin.py b/plugins/Sidebar/SidebarPlugin.py index 21269935..6f1b525e 100644 --- a/plugins/Sidebar/SidebarPlugin.py +++ b/plugins/Sidebar/SidebarPlugin.py @@ -144,7 +144,10 @@ class UiWebsocketPlugin(object): else: size = size_filetypes.get(extension, 0) 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"
  • " % (percent, extension, color, extension)) # Legend