GH-1556 do not crash when instance has no update task while creating an instance
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user