From 72c92893a5669a91e3d48b1341b6fde306db9a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 27 Apr 2016 23:55:18 +0200 Subject: GH-1556 do not crash when instance has no update task while creating an instance --- application/dialogs/ProgressDialog.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'application/dialogs') 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; -- cgit v1.2.3