From ac1800703f375097ed82a9af65c81e6bd3f559b4 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Mon, 2 May 2016 21:54:32 +0300 Subject: [PATCH] avatar reset bug fixed --- src/file_transfers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/file_transfers.py b/src/file_transfers.py index 7eb936e..4dfc945 100644 --- a/src/file_transfers.py +++ b/src/file_transfers.py @@ -16,7 +16,7 @@ TOX_FILE_TRANSFER_STATE = { class StateSignal(QtCore.QObject): - signal = QtCore.Signal(int, float) + signal = QtCore.Signal(int, float) # state and progress class FileTransfer(QtCore.QObject): @@ -98,7 +98,8 @@ class SendTransfer(FileTransfer): self._done += size self._state_changed.signal.emit(self.state, self._done / self._size) else: - self._file.close() + if hasattr(self, '_file'): + self._file.close() self.state = TOX_FILE_TRANSFER_STATE['FINISHED'] self._state_changed.signal.emit(self.state, 1)