diff options
author | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2012-03-15 10:53:07 +0100 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2012-03-15 10:56:33 +0100 |
commit | ceaa3e746195d0d4710998e1b105d03867ae3334 (patch) | |
tree | e4b76659235f9e5e9b67f749bcfe4a85e57266ef | |
parent | d97768f96b38650bbcc6420cc9db9e95ae15ee85 (diff) |
Wizards: crash fixv2.5.0-beta
In the case of cancel currentItem is null.
Change-Id: I337bcf9e1873e9f6525c898c7275ec594f9baeb6
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
-rw-r--r-- | src/plugins/coreplugin/dialogs/newdialog.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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; |