From c00d709a545afb14400810f03a8d87d9f4e21302 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 1 Mar 2024 12:00:24 +0300 Subject: fixes #4258 (Telegram: occasional crash in Options - Sessions) --- protocols/Telegram/src/options.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'protocols/Telegram/src') diff --git a/protocols/Telegram/src/options.cpp b/protocols/Telegram/src/options.cpp index 86f342269a..e9d5f83b9b 100644 --- a/protocols/Telegram/src/options.cpp +++ b/protocols/Telegram/src/options.cpp @@ -201,6 +201,8 @@ public: bool OnInitDialog() override { + m_list.SetExtendedListViewStyleEx(LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT); + LVCOLUMN lvc = {}; lvc.mask = LVCF_TEXT | LVCF_WIDTH; @@ -235,6 +237,9 @@ public: void onContextMenu(CContextMenuPos *pos) { + if (pos->iCurr == -1) + return; + HMENU hMenu = CreatePopupMenu(); AppendMenuW(hMenu, MF_STRING, 100, TranslateT("Kill session")); -- cgit v1.2.3