From df0c1f814a1fb3a002a118cecab18d72ca3d5030 Mon Sep 17 00:00:00 2001 From: AlexeyZavar Date: Tue, 20 Feb 2024 22:32:41 +0300 Subject: [PATCH] fix: skill issue Pro-tip: don't watch anime while coding. --- Telegram/SourceFiles/data/data_chat_filters.cpp | 3 ++- Telegram/SourceFiles/storage/storage_sparse_ids_list.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/data/data_chat_filters.cpp b/Telegram/SourceFiles/data/data_chat_filters.cpp index c37eddd65c..20fadb41de 100644 --- a/Telegram/SourceFiles/data/data_chat_filters.cpp +++ b/Telegram/SourceFiles/data/data_chat_filters.cpp @@ -775,7 +775,8 @@ FilterId ChatFilters::defaultId() const { } FilterId ChatFilters::lookupId(int index) const { - if (index >= 0 && index < _list.size()) { + // Expects(index >= 0 && index < _list.size()); + if (!(index >= 0 && index < _list.size())) { return FilterId(); // AyuGram: fix crash when using `hideAllChatsFolder` } diff --git a/Telegram/SourceFiles/storage/storage_sparse_ids_list.cpp b/Telegram/SourceFiles/storage/storage_sparse_ids_list.cpp index 507f00c0a6..db18b927cf 100644 --- a/Telegram/SourceFiles/storage/storage_sparse_ids_list.cpp +++ b/Telegram/SourceFiles/storage/storage_sparse_ids_list.cpp @@ -62,7 +62,8 @@ SparseIdsList::AddResult SparseIdsList::addRangeItemsAndCountNew( SparseIdsSliceUpdate &update, const Range &messages, MsgRange noSkipRange) { - if (noSkipRange.from <= noSkipRange.till) { + // Expects(noSkipRange.from <= noSkipRange.till); + if (!(noSkipRange.from <= noSkipRange.till)) { return { 0 }; // AyuGram: fix crash when using `saveDeletedMessages` }