summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-11-29 17:19:18 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-11-29 17:19:18 +0300
commit4f591aa09025880f17bb8292a7dc174c14c29236 (patch)
treea6453f9f0fe0f3baa90fd55ae9e4d3b312032493 /plugins
parent585c4d7595173e805523799b737bfd3044468fcd (diff)
fixes #3979 (NewStory: падение при ПКМ по пустому журналу)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewStory/src/history_menus.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/NewStory/src/history_menus.cpp b/plugins/NewStory/src/history_menus.cpp
index e1801d07f4..2404fa0a6b 100644
--- a/plugins/NewStory/src/history_menus.cpp
+++ b/plugins/NewStory/src/history_menus.cpp
@@ -34,8 +34,9 @@ static HGENMENU hmiCopy, hmiCopyText, hmiEdit, hmiBookmark, hmiDelete;
HMENU NSMenu_Build(NewstoryListData *data, ItemData *item)
{
bool bNotProtected = true;
- if (auto *szProto = Proto_GetBaseAccountName(item->hContact))
- bNotProtected = db_get_b(item->hContact, szProto, "Protected") == 0;
+ if (item != nullptr)
+ if (auto *szProto = Proto_GetBaseAccountName(item->hContact))
+ bNotProtected = db_get_b(item->hContact, szProto, "Protected") == 0;
Menu_ShowItem(hmiCopy, bNotProtected);
Menu_ShowItem(hmiCopyText, bNotProtected);