diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 06b809a20..2af6f3e59 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -678,6 +678,8 @@ 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 not os.path.isdir(temp_dir): + return for filename in os.listdir(temp_dir): os.remove(os.path.join(temp_dir, filename)) os.removedirs(temp_dir) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index bd953ffac..1d3f12ede 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -255,6 +255,8 @@ class SongsPlugin(Plugin): """ db_dir = unicode(os.path.join(gettempdir(), u'openlp')) song_dbs = [] + if not os.path.isdir(db_dir): + return for sfile in os.listdir(db_dir): if sfile.startswith(u'songs_') and sfile.endswith(u'.sqlite'): song_dbs.append(os.path.join(db_dir, sfile))