It's safe to delete a Null Pointer

So don't check it with an if.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-10-09 18:19:10 -03:00 committed by Dirk Hohndel
parent 6930c689b7
commit 628eb76af4

View file

@ -1901,8 +1901,7 @@ void MainWindow::setApplicationState(const QByteArray& state) {
void MainWindow::showProgressBar()
{
if (progressDialog)
delete progressDialog;
delete progressDialog;
progressDialog = new QProgressDialog(tr("Contacting cloud service..."), tr("Cancel"), 0, 100, this);
progressDialog->setWindowModality(Qt::WindowModal);