mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-07 04:05:17 +00:00
402cb0e668
ChatFilters::applyRemove() emptied the filter in the list and only then detached its chats. Unpinning a chat re-caches its siblings' pinned indices, which runs Session::refreshChatListEntry(); seeing the filter still listed but emptied, it re-entered removeFromChatList() -> setChatPinned() -> PinnedList::setPinned() on the same pinned list while its re-cache loop iterated with a cached size, reading past the end of the vector. This aborted on closing the Folders editor after removing two or more folders that had pinned chats. Detach the filter from the list before applyChange() tears down its chats, so the re-entrant refresh no longer touches it. Also harden the setPinned() re-cache loop to re-check the container size each iteration as defense in depth. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>