KFilePlacesView: Fix potential crash in `previousVisibleIndex`
The previous commit fixed a crash in `KFilePlacesViewDelegate::previousVisibleIndex`, where access to `model` failed due to an invalid index. In addition to the previous commit already fixing the crash, unrelated potential crashes in the future can be avoided by checking for an invalid `index` in `previousVisibleIndex`. The existing logic of `indexIsSectionHeader` is kept intact, since now an invalid `index` will lead to comparing two empty strings, i.e. it will not be considered a section header as required by the rest of the code. This fix alone would already solve the crash without any side effects, still introducing `m_dropIndex` seemed less brittle. CCBUG: 450813 CCBUG: 450966 Test Plan: Functionality related to dragging places around (including existing bugs) is unaffected.
parent
38662957
Loading
Loading
Pipeline
#145214
passed
with stage
in
8 minutes and 3 seconds
Loading
Please register or sign in to comment