From 39bd52c1e29a032c7e2d9e6dffa1c5f24ca6d15a Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 22 Dec 2025 13:46:29 +0400 Subject: [PATCH] Fix crash in bot chat userpic right click. --- Telegram/SourceFiles/history/history_inner_widget.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 793d370f71..ef899d3dcb 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2393,8 +2393,12 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _widget->fillSenderUserpicMenu( _menu.get(), session->data().peer(PeerId(linkUserpicPeerId))); - _menu->popup(e->globalPos()); - e->accept(); + if (_menu->empty()) { + _menu = nullptr; + } else { + _menu->popup(e->globalPos()); + e->accept(); + } return; } const auto controller = _controller;