mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
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 f0c90a47de
)
This commit is contained in:
parent
bf202f3931
commit
fe1e3f240a
1 changed files with 1 additions and 1 deletions
|
@ -1499,7 +1499,7 @@ int KFileItemModel::expandedParentsCountCompare(const ItemData* a, const ItemDat
|
||||||
if (index > maxIndex) {
|
if (index > maxIndex) {
|
||||||
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;
|
--index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue