diff options
Diffstat (limited to 'plugins/NewStory/src')
-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)) |