mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix possible crash in gift box sticker lookup.
This commit is contained in:
parent
3c6037a798
commit
4471eb587d
1 changed files with 2 additions and 0 deletions
|
@ -26,6 +26,8 @@ DocumentData *GiftBoxPack::lookup(int months) const {
|
||||||
const auto fallback = _documents.empty() ? nullptr : _documents[0];
|
const auto fallback = _documents.empty() ? nullptr : _documents[0];
|
||||||
if (it == begin(_localMonths)) {
|
if (it == begin(_localMonths)) {
|
||||||
return fallback;
|
return fallback;
|
||||||
|
} else if (it == end(_localMonths)) {
|
||||||
|
return _documents.back();
|
||||||
}
|
}
|
||||||
const auto left = *(it - 1);
|
const auto left = *(it - 1);
|
||||||
const auto right = *it;
|
const auto right = *it;
|
||||||
|
|
Loading…
Add table
Reference in a new issue