diff options
| author | Michael Jansen <[email protected]> | 2012-12-30 20:56:59 +0100 |
|---|---|---|
| committer | Michael Jansen <[email protected]> | 2012-12-30 20:57:48 +0100 |
| commit | ed4644bd875bce2bb797a96652b4aced9eb75976 (patch) | |
| tree | 7c2a93aba65b2a4d7b850339422d6f6e54745b74 | |
| parent | c473003fca026301dbe7db92e82cfc474e001a52 (diff) | |
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.
| -rw-r--r-- | src/kitemviews/kfileitemmodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 231bfe077..6c015db37 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -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; } |
