From e91eecf34f7f2b82041ebaf3e7549067738a7311 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 19 Jan 2022 18:52:01 +0300 Subject: [PATCH] Fix possible crash in empty sticker set. --- Telegram/SourceFiles/boxes/stickers_box.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/stickers_box.cpp b/Telegram/SourceFiles/boxes/stickers_box.cpp index d11dcefa0..1b8ce6cbc 100644 --- a/Telegram/SourceFiles/boxes/stickers_box.cpp +++ b/Telegram/SourceFiles/boxes/stickers_box.cpp @@ -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)) {