Fix ticket #2269 ([GUI] Crash when rechecking files while having hidden stuff)

If there is no current item show empty details panel.
This commit is contained in:
Kimmo Varis 2010-12-01 18:19:37 +02:00
parent 1a3175741f
commit 9731c736e5
1 changed files with 6 additions and 0 deletions

View File

@ -277,6 +277,12 @@ void ResultsView::UpdateDetails(const QModelIndex &index)
QStandardItemModel *model = qobject_cast<QStandardItemModel*>(mUI.mTree->model());
QStandardItem *item = model->itemFromIndex(index);
if (!item)
{
mUI.mDetails->setText("");
return;
}
// Make sure we are working with the first column
if (item->parent() && item->column() != 0)
item = item->parent()->child(item->row(), 0);