GH-1556 do not crash when instance has no update task while creating an instance
This commit is contained in:
parent
0890a81695
commit
72c92893a5
@ -1185,8 +1185,11 @@ void MainWindow::finalizeInstance(InstancePtr inst)
|
||||
QString error = QString("Instance load failed: %1").arg(reason);
|
||||
CustomMessageBox::selectable(this, tr("Error"), error, QMessageBox::Warning)->show();
|
||||
});
|
||||
if(update)
|
||||
{
|
||||
loadDialog.execWithTask(update.get());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CustomMessageBox::selectable(this, tr("Error"), tr("MultiMC cannot download Minecraft or update instances unless you have at least "
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "ui_ProgressDialog.h"
|
||||
|
||||
#include <QKeyEvent>
|
||||
#include <QDebug>
|
||||
|
||||
#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;
|
||||
|
Loading…
Reference in New Issue
Block a user