From ceaa3e746195d0d4710998e1b105d03867ae3334 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 15 Mar 2012 10:53:07 +0100 Subject: [PATCH] Wizards: crash fix In the case of cancel currentItem is null. Change-Id: I337bcf9e1873e9f6525c898c7275ec594f9baeb6 Reviewed-by: Daniel Teske --- src/plugins/coreplugin/dialogs/newdialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index 9180a752ab..28d81bfa77 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -333,7 +333,9 @@ Core::IWizard *NewDialog::showDialog() const int retVal = exec(); idx = m_ui->templateCategoryView->currentIndex(); - lastCategory = m_model->itemFromIndex(m_twoLevelProxyModel->mapToSource(idx))->data(Qt::UserRole).toString(); + QStandardItem *currentItem = m_model->itemFromIndex(m_twoLevelProxyModel->mapToSource(idx)); + if (currentItem) + lastCategory = currentItem->data(Qt::UserRole).toString(); if (retVal != Accepted) return 0; -- GitLab