From feabb5bd71319d52cf145c861833223dbdc905ff Mon Sep 17 00:00:00 2001 From: Reupen Shah Date: Sat, 15 Oct 2022 20:20:40 +0100 Subject: [PATCH] Fix crash clicking Move down in playlist view preferences groups list This fixes a crash when clicking Move down on the Grouping tab in playlist view preferences, when there wasn't a group selected. This regressed in #595. --- CHANGELOG.md | 8 ++++++-- foo_ui_columns/ng_playlist/ng_playlist_config.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c85921b1..70bbe12d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change log -## Development version +## 2.0.0-alpha.4 ### Features @@ -17,7 +17,11 @@ ### Bug fixes -- Flickering or flashing when switching tabs in the Tab stack panel was reduced. +- A crash, when clicking Move down on the Grouping tab in playlist view + preferences without a group selected, was fixed. + [[#613](https://github.com/reupen/columns_ui/pull/613)] + +- Flickering when switching tabs in the Tab stack panel was reduced. [[#610](https://github.com/reupen/columns_ui/pull/610)] ## 2.0.0-alpha.3 diff --git a/foo_ui_columns/ng_playlist/ng_playlist_config.cpp b/foo_ui_columns/ng_playlist/ng_playlist_config.cpp index bc62ad4a5..f64d08f33 100644 --- a/foo_ui_columns/ng_playlist/ng_playlist_config.cpp +++ b/foo_ui_columns/ng_playlist/ng_playlist_config.cpp @@ -114,7 +114,7 @@ BOOL GroupsPreferencesTab::ConfigProc(HWND wnd, UINT msg, WPARAM wp, LPARAM lp) const auto index = m_groups_list_view.get_selected_item_single(); auto& groups = g_groups.get_groups(); - if (index + 1 >= groups.size()) + if (index == std::numeric_limits::max() || index + 1 >= groups.size()) break; g_groups.swap(index, index + 1);