fix: skill issue

Pro-tip: don't watch anime while coding.
This commit is contained in:
AlexeyZavar 2024-02-20 22:32:41 +03:00
parent 7e62f8749d
commit df0c1f814a
2 changed files with 4 additions and 2 deletions

View file

@ -775,7 +775,8 @@ FilterId ChatFilters::defaultId() const {
} }
FilterId ChatFilters::lookupId(int index) 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` return FilterId(); // AyuGram: fix crash when using `hideAllChatsFolder`
} }

View file

@ -62,7 +62,8 @@ SparseIdsList::AddResult SparseIdsList::addRangeItemsAndCountNew(
SparseIdsSliceUpdate &update, SparseIdsSliceUpdate &update,
const Range &messages, const Range &messages,
MsgRange noSkipRange) { 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` return { 0 }; // AyuGram: fix crash when using `saveDeletedMessages`
} }