SVN commit 744930 by ereslibre: Avoid crashes and make the code more rock-solid M +16 -0 kdiroperator.cpp --- trunk/KDE/kdelibs/kfile/kdiroperator.cpp #744929:744930 @@ -1932,6 +1932,10 @@ const QModelIndex dirIndex = proxyModel->mapToSource(index); KFileItem item = dirModel->itemForIndex(dirIndex); bool selectDir = false; + + if (item.isNull()) + return; + if (item.isDir()) { const Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers(); selectDir = KGlobalSettings::singleClick() && @@ -1954,6 +1958,10 @@ const QModelIndex dirIndex = proxyModel->mapToSource(index); KFileItem item = dirModel->itemForIndex(dirIndex); + + if (item.isNull()) + return; + if (item.isDir()) { parent->selectDir(item); } else { @@ -1985,6 +1993,10 @@ const QModelIndex proxyIndex = itemView->indexAt(pos); const QModelIndex dirIndex = proxyModel->mapToSource(proxyIndex); KFileItem item = dirModel->itemForIndex(dirIndex); + + if (item.isNull()) + return; + parent->activatedMenu(item, QCursor::pos()); } @@ -1993,6 +2005,10 @@ if ((preview != 0) && index.isValid() && (index.column() == KDirModel::Name)) { const QModelIndex dirIndex = proxyModel->mapToSource(index); const KFileItem item = dirModel->itemForIndex(dirIndex); + + if (item.isNull()) + return; + if (!item.isDir()) { previewUrl = item.url(); previewTimer->start(300);