diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-10 18:52:02 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-10 18:52:06 +0300 |
commit | 07feb451bf28c855a383b395d1d27eb6e2558b66 (patch) | |
tree | 2c4ab0997d23d0ee91e25bd38dea3fb49b159209 /plugins | |
parent | 83d9bcd403cc96cd82059d0e990d207f795343a7 (diff) |
fixes #4039 (NewStory: Forward из чата с пустым журналом приводит к падению)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/NewStory/src/history_svc.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/NewStory/src/history_svc.cpp b/plugins/NewStory/src/history_svc.cpp index e8dc1a154f..ad3d508df6 100644 --- a/plugins/NewStory/src/history_svc.cpp +++ b/plugins/NewStory/src/history_svc.cpp @@ -38,11 +38,10 @@ static INT_PTR SvcGetSelection(WPARAM wParam, LPARAM lParam) auto *pData = (NewstoryListData *)wParam; auto *pRet = (std::vector<MEVENT>*)lParam; if (pData && pRet) { - for (int i = pData->totalCount; i >= 0; i--) { - auto *p = pData->items.get(i); - if (p->m_bSelected) - pRet->push_back(p->hEvent); - } + for (int i = pData->totalCount; i >= 0; i--) + if (auto *p = pData->items.get(i)) + if (p->m_bSelected) + pRet->push_back(p->hEvent); if (pRet->empty() && pData->caret != -1) if (auto *p = pData->GetItem(pData->caret)) |