From c58fb4379589017d7d6b1a7f9c712832cba5386d Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sun, 30 Sep 2018 16:52:48 +1000 Subject: [PATCH] Ignore attribute error when optimistically trying to cancel compression (we may have no ZipWriter object yet) --- onionshare_gui/share_mode/threads.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/onionshare_gui/share_mode/threads.py b/onionshare_gui/share_mode/threads.py index d6022746..24e2c242 100644 --- a/onionshare_gui/share_mode/threads.py +++ b/onionshare_gui/share_mode/threads.py @@ -56,5 +56,8 @@ class CompressThread(QtCore.QThread): # Let the Web and ZipWriter objects know that we're canceling compression early self.mode.web.cancel_compression = True - if self.mode.web.zip_writer: + try: self.mode.web.zip_writer.cancel_compression = True + except AttributeError: + # we never made it as far as creating a ZipWriter object + pass