diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 181cab1aa..a115d8905 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -657,10 +657,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): plugin.firstTime() Receiver.send_message(u'openlp_process_events') temp_dir = os.path.join(unicode(gettempdir()), u'openlp') - if os.path.exists(temp_dir): - for filename in os.listdir(temp_dir): - delete_file(os.path.join(temp_dir, filename)) - os.removedirs(temp_dir) + if not os.path.exists(temp_dir): + return + for filename in os.listdir(temp_dir): + delete_file(os.path.join(temp_dir, filename)) + os.removedirs(temp_dir) def blankCheck(self): """