mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-24 06:22:59 +02:00
Fix possible crash in subsection tabs.
This commit is contained in:
parent
28e7afa412
commit
6a43107bb2
1 changed files with 6 additions and 2 deletions
|
@ -341,11 +341,15 @@ void SubsectionTabs::setupSlider(
|
|||
scrollSavingIndex = -1;
|
||||
for (auto index = 0; index != count; ++index) {
|
||||
const auto thread = _sectionsSlice[index].thread;
|
||||
if (ranges::contains(_slice, thread, &Item::thread)) {
|
||||
const auto i = ranges::find(
|
||||
_slice,
|
||||
thread,
|
||||
&Item::thread);
|
||||
if (i != end(_slice)) {
|
||||
scrollSavingThread = thread;
|
||||
scrollSavingShift = scrollValue
|
||||
- slider->lookupSectionPosition(index);
|
||||
scrollSavingIndex = index;
|
||||
scrollSavingIndex = int(i - begin(_slice));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue