From bb32c546d4511cbd5950d8a3fe5ab8992b87a1ec Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 17 Nov 2024 23:24:08 +0400 Subject: [PATCH] Fix possible crash in swipe to reply. --- .../history/view/history_view_replies_section.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp index 5531cae2e..687551768 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp @@ -916,8 +916,9 @@ void RepliesWidget::setupSwipeReply() { result.callback = [=, itemId = view->data()->fullId()] { const auto still = show->session().data().message(itemId); const auto view = _inner->viewByPosition(still->position()); - const auto selected = view->selectedQuote( - _inner->getSelectedTextRange(still)); + const auto selected = view + ? view->selectedQuote(_inner->getSelectedTextRange(still)) + : SelectedQuote(); const auto replyToItemId = (selected.item ? selected.item : still)->fullId();