diff --git a/Telegram/SourceFiles/chat_helpers/stickers_gift_box_pack.cpp b/Telegram/SourceFiles/chat_helpers/stickers_gift_box_pack.cpp index 043636808..d45c814cf 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_gift_box_pack.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_gift_box_pack.cpp @@ -62,13 +62,13 @@ void GiftBoxPack::applySet(const MTPDmessages_stickerSet &data) { const auto document = _session->data().processDocument(sticker); if (document->sticker()) { documents.emplace(document->id, document); + if (_documents.empty()) { + // Fallback. + _documents.resize(1); + _documents[0] = document; + } } } - if (!documents.empty()) { - // Fallback. - _documents.resize(1); - _documents[0] = documents.begin()->second.get(); - } for (const auto &pack : data.vpacks().v) { pack.match([&](const MTPDstickerPack &data) { const auto emoji = qs(data.vemoticon());