Fix crash in bot chat userpic right click.

This commit is contained in:
John Preston
2025-12-22 13:46:29 +04:00
parent e55f394db5
commit 39bd52c1e2

View File

@@ -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;