diff --git a/kcc/KCC_gui.py b/kcc/KCC_gui.py index 9445088..342b0da 100644 --- a/kcc/KCC_gui.py +++ b/kcc/KCC_gui.py @@ -328,9 +328,10 @@ class WorkerThread(QtCore.QThread): 'for more details.', 'error', False) MW.addTrayMessage.emit('Error during conversion!', 'Critical') if not self.conversionAlive: - for item in outputPath: - if os.path.exists(item): - os.remove(item) + if 'outputPath' in locals(): + for item in outputPath: + if os.path.exists(item): + os.remove(item) self.clean() return if not self.errors: