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` }