From: Frank Reininghaus Date: Tue, 11 Sep 2012 17:43:53 +0000 (+0200) Subject: Fix possible crash when refreshing the view while renaming inline X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/42dad0a9483de340118ce67622cb930619dd4699 Fix possible crash when refreshing the view while renaming inline It is not reproducible on every machine for me, but it seems that it can happen that DolphinView's slot slotRoleEditingFinished() is invoked after the items have already been removed from the model. In that case, we have to return from the slot immediately to prevent a crash. BUG: 306147 FIXED-IN: 4.9.2 --- diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 08e26c5d6..72ccb8372 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1321,6 +1321,10 @@ void DolphinView::slotVisibleRolesChangedByHeader(const QList& curre void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value) { + if (index < 0 || index >= m_model->count()) { + return; + } + if (role == "text") { const KFileItem oldItem = m_model->fileItem(index); const QString newName = value.toString();