From f29ac1d2849f720868da0eae03981a446c0316a0 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 4 Jun 2013 13:22:36 -0500 Subject: Fix sporadic Kate crash first reported in KDE bug 140135 --- kate/app/katefilelist.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'kate/app') diff --git a/kate/app/katefilelist.cpp b/kate/app/katefilelist.cpp index 24062336a..05763e988 100644 --- a/kate/app/katefilelist.cpp +++ b/kate/app/katefilelist.cpp @@ -364,11 +364,16 @@ void KateFileList::updateFileListLocations() TQListViewItem* item = firstChild(); int i=0; while (item) { + Kate::Document* itemDocument = ((KateFileListItem *)item)->document(); if (m_sort == KateFileList::sortManual) { - ((KateFileListItem *)item)->document()->setDocumentListPosition(i); + if (KateDocManager::self()->findDocument(itemDocument) >= 0) { + itemDocument->setDocumentListPosition(i); + } } else { - ((KateFileListItem *)item)->document()->setDocumentListPosition(-1); + if (KateDocManager::self()->findDocument(itemDocument) >= 0) { + itemDocument->setDocumentListPosition(-1); + } } item = item->itemBelow(); i++; -- cgit v1.2.1