From b41c94be290d3991a37fc6470abfde13c18ea7b9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 2 Nov 2023 16:44:41 +0400 Subject: [PATCH] Fix crash in link preview edit. --- .../history/view/controls/history_view_draft_options.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp b/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp index 3438ab15d..65a1cd6de 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp @@ -638,10 +638,11 @@ void DraftOptionsBox( const auto &highlight = args.highlight; const auto &clearOldDraft = args.clearOldDraft; const auto resolveReply = [=] { - const auto current = state->quote.current(); auto result = draft.reply; - result.messageId = current.item->fullId(); - result.quote = current.text; + if (const auto current = state->quote.current()) { + result.messageId = current.item->fullId(); + result.quote = current.text; + } return result; }; const auto finish = [=](