Fix possible crash in empty sticker set.

This commit is contained in:
John Preston 2022-01-19 18:52:01 +03:00
parent 1a8cc87e60
commit e91eecf34f

View File

@ -2186,7 +2186,7 @@ void StickersBox::Inner::rebuildAppendSet(
raw->yadd = {};
auto oldStickerMedia = std::move(raw->stickerMedia);
auto oldThumbnailMedia = std::move(raw->thumbnailMedia);
raw->stickerMedia = sticker->activeMediaView();
raw->stickerMedia = sticker ? sticker->activeMediaView() : nullptr;
raw->thumbnailMedia = set->activeThumbnailView();
if (raw->thumbnailMedia != oldThumbnailMedia
|| (!raw->thumbnailMedia && raw->stickerMedia != oldStickerMedia)) {