From 9721b22f613c57526c92a3d41295374a22595f84 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 7 Jun 2023 21:40:35 +0300 Subject: NewStory: fix for a very rare crash --- plugins/NewStory/src/history_control.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 99e7c3e3bf..2e17209030 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -462,8 +462,8 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM std::swap(start, end); for (int i = start; i <= end; ++i) { - auto *p = data->items.get(i, false); - p->bSelected = true; + if (auto *p = data->items.get(i, false)) + p->bSelected = true; } InvalidateRect(hwnd, 0, FALSE); -- cgit v1.2.3