diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 8f3a8aa0f..84625e51f 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -552,7 +552,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, LogMixin, RegistryPropert wait_dialog.setAutoClose(False) wait_dialog.setCancelButton(None) wait_dialog.show() - for thread_name in self.application.worker_threads.keys(): + thread_names = self.application.worker_threads.keys() + for thread_name in thread_names: + if thread_name not in self.application.worker_threads.keys(): + continue self.log_debug('Waiting for thread %s' % thread_name) self.application.processEvents() thread = self.application.worker_threads[thread_name]['thread']