From 8a974273b9f6b5377059423882a24325258a7ecd Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 13 Jul 2023 09:12:05 +0400 Subject: [PATCH] Fix possible crash in click handling. --- Telegram/SourceFiles/data/data_sponsored_messages.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/data/data_sponsored_messages.cpp b/Telegram/SourceFiles/data/data_sponsored_messages.cpp index bbf6273c5..fa21af469 100644 --- a/Telegram/SourceFiles/data/data_sponsored_messages.cpp +++ b/Telegram/SourceFiles/data/data_sponsored_messages.cpp @@ -385,7 +385,7 @@ const SponsoredMessages::Entry *SponsoredMessages::find( } auto &list = it->second; const auto entryIt = ranges::find_if(list.entries, [&](const Entry &e) { - return e.item->fullId() == fullId; + return e.item && e.item->fullId() == fullId; }); if (entryIt == end(list.entries)) { return nullptr;