diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index f059b275..da9ea779 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -1185,7 +1185,10 @@ void MainWindow::finalizeInstance(InstancePtr inst) QString error = QString("Instance load failed: %1").arg(reason); CustomMessageBox::selectable(this, tr("Error"), error, QMessageBox::Warning)->show(); }); - loadDialog.execWithTask(update.get()); + if(update) + { + loadDialog.execWithTask(update.get()); + } } else { diff --git a/application/dialogs/ProgressDialog.cpp b/application/dialogs/ProgressDialog.cpp index bca4e168..17ab79cd 100644 --- a/application/dialogs/ProgressDialog.cpp +++ b/application/dialogs/ProgressDialog.cpp @@ -17,6 +17,7 @@ #include "ui_ProgressDialog.h" #include +#include #include "tasks/Task.h" @@ -57,6 +58,12 @@ int ProgressDialog::execWithTask(Task *task) this->task = task; QDialog::DialogCode result; + if(!task) + { + qDebug() << "Programmer error: progress dialog created with null task."; + return Accepted; + } + if(handleImmediateResult(result)) { return result;