mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 10:11:41 -05:00
Fix crash in message history context menu.
Regression was introduced in 6d48ca850e
.
This commit is contained in:
parent
de16a66a4a
commit
b3a723c871
1 changed files with 6 additions and 4 deletions
|
@ -1387,14 +1387,16 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
auto item = App::hoveredItem()
|
auto item = App::hoveredItem()
|
||||||
? App::hoveredItem()
|
? App::hoveredItem()
|
||||||
: App::hoveredLinkItem();
|
: App::hoveredLinkItem();
|
||||||
const auto group = item->getFullGroup();
|
if (const auto group = item ? item->getFullGroup() : nullptr) {
|
||||||
if (group) {
|
|
||||||
item = group->others.empty()
|
item = group->others.empty()
|
||||||
? group->leader
|
? group->leader
|
||||||
: group->others.front().get();
|
: group->others.front().get();
|
||||||
}
|
}
|
||||||
bool canDelete = item && item->canDelete() && (item->id > 0 || !item->serviceMsg());
|
const auto canDelete = item
|
||||||
bool canForward = item && item->canForward();
|
&& item->canDelete()
|
||||||
|
&& (item->id > 0 || !item->serviceMsg());
|
||||||
|
const auto canForward = item
|
||||||
|
&& item->canForward();
|
||||||
|
|
||||||
auto msg = dynamic_cast<HistoryMessage*>(item);
|
auto msg = dynamic_cast<HistoryMessage*>(item);
|
||||||
if (isUponSelected > 0) {
|
if (isUponSelected > 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue