Wizards: crash fix

In the case of cancel currentItem is null.

Change-Id: I337bcf9e1873e9f6525c898c7275ec594f9baeb6
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Thomas Hartmann
2012-03-15 10:53:07 +01:00
parent d97768f96b
commit ceaa3e7461

View File

@@ -333,7 +333,9 @@ Core::IWizard *NewDialog::showDialog()
const int retVal = exec(); const int retVal = exec();
idx = m_ui->templateCategoryView->currentIndex(); 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) if (retVal != Accepted)
return 0; return 0;