Commit 90c7fd40 authored by Michael Jansen's avatar Michael Jansen

Fix crash when browsing bluetooth device.

When trying to browse a N900 it crashed here because pathA was empty. Which
lead to index = maxIndex beeing -1 and pathA.at(index) crashing.

Reorder the while condition to prevent that courtesy of tsdgeos.

(cherry picked from commit f0c90a47)
parent 506874ce
......@@ -1499,7 +1499,7 @@ int KFileItemModel::expandedParentsCountCompare(const ItemData* a, const ItemDat
if (index > maxIndex) {
index = maxIndex;
}
while ((pathA.at(index) != QLatin1Char('/') || pathB.at(index) != QLatin1Char('/')) && index > 0) {
while (index > 0 && (pathA.at(index) != QLatin1Char('/') || pathB.at(index) != QLatin1Char('/'))) {
--index;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment