mirror of https://github.com/procxx/kepka.git
Fix crash in sticker set parsing.
This commit is contained in:
parent
aaa4db7b27
commit
4695ebae6e
|
@ -973,16 +973,19 @@ Set *FeedSetFull(const MTPmessages_StickerSet &data) {
|
||||||
const auto &s = d.vset().c_stickerSet();
|
const auto &s = d.vset().c_stickerSet();
|
||||||
|
|
||||||
auto &sets = Auth().data().stickerSetsRef();
|
auto &sets = Auth().data().stickerSetsRef();
|
||||||
auto it = sets.find(s.vid().v);
|
const auto wasArchived = [&] {
|
||||||
const auto wasArchived = (it->second->flags & MTPDstickerSet::Flag::f_archived);
|
auto it = sets.find(s.vid().v);
|
||||||
|
return (it != sets.end())
|
||||||
|
&& (it->second->flags & MTPDstickerSet::Flag::f_archived);
|
||||||
|
}();
|
||||||
|
|
||||||
auto set = FeedSet(s);
|
auto set = FeedSet(s);
|
||||||
|
|
||||||
set->flags &= ~MTPDstickerSet_ClientFlag::f_not_loaded;
|
set->flags &= ~MTPDstickerSet_ClientFlag::f_not_loaded;
|
||||||
|
|
||||||
auto &d_docs = d.vdocuments().v;
|
const auto &d_docs = d.vdocuments().v;
|
||||||
auto customIt = sets.find(Stickers::CustomSetId);
|
auto customIt = sets.find(Stickers::CustomSetId);
|
||||||
auto inputSet = MTP_inputStickerSetID(
|
const auto inputSet = MTP_inputStickerSetID(
|
||||||
MTP_long(set->id),
|
MTP_long(set->id),
|
||||||
MTP_long(set->access));
|
MTP_long(set->access));
|
||||||
|
|
||||||
|
@ -1055,7 +1058,7 @@ Set *FeedSetFull(const MTPmessages_StickerSet &data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (set) {
|
if (set) {
|
||||||
const auto isArchived = (set->flags & MTPDstickerSet::Flag::f_archived);
|
const auto isArchived = !!(set->flags & MTPDstickerSet::Flag::f_archived);
|
||||||
if (set->flags & MTPDstickerSet::Flag::f_installed_date) {
|
if (set->flags & MTPDstickerSet::Flag::f_installed_date) {
|
||||||
if (!isArchived) {
|
if (!isArchived) {
|
||||||
Local::writeInstalledStickers();
|
Local::writeInstalledStickers();
|
||||||
|
|
Loading…
Reference in New Issue