From 96e623ef57211e49a87924c5f15f0d62fbd8dac9 Mon Sep 17 00:00:00 2001 From: Shivam Jha Date: Wed, 5 Feb 2020 01:52:43 -0800 Subject: [PATCH] UploadStatus: Handle exception ZeroDivisionError --- bot/helper/mirror_utils/status_utils/upload_status.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/helper/mirror_utils/status_utils/upload_status.py b/bot/helper/mirror_utils/status_utils/upload_status.py index a7e7c60be..0da5e905e 100644 --- a/bot/helper/mirror_utils/status_utils/upload_status.py +++ b/bot/helper/mirror_utils/status_utils/upload_status.py @@ -28,7 +28,10 @@ def name(self): return self.obj.name def progress_raw(self): - return self.obj.uploaded_bytes / self.__size * 100 + try: + return self.obj.uploaded_bytes / self.__size * 100 + except ZeroDivisionError: + return 0 def progress(self): return f'{round(self.progress_raw(), 2)}%'