Skip to content

Commit 55601cb

Browse files
authored
Issue 657: CalChart on Mac crashes when last continuity for any dot type is deleted (#659)
1 parent fc2e4fe commit 55601cb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

LATEST_RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Bugs addressed in this release:
44

55
* [#579](../../issues/579) Changing CalChart name in /Applications can make it loose the help system
6+
* [#657](../../issues/657) CalChart on Mac crashes when last continuity for any dot type is deleted
67
* [#660](../../issues/660) Why are only some of the marchers selected in animation view
78

89
Other changes:

src/CustomListViewPanel.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,14 @@ CustomListViewPanel::CustomListViewPanel(wxWindow* parent, wxWindowID winid, wxP
193193
void CustomListViewPanel::SetCells(std::vector<std::unique_ptr<DrawableCell>> cells)
194194
{
195195
mCells = std::move(cells);
196+
if (m_selected) {
197+
if (mCells.empty()) {
198+
m_selected = std::nullopt;
199+
} else {
200+
m_selected = std::min(*m_selected, mCells.size() - 1);
201+
}
202+
}
203+
196204
auto total_y = std::accumulate(mCells.begin(), mCells.end(), 0, [](auto&& a, auto&& b) {
197205
return a + b->Height();
198206
});

0 commit comments

Comments
 (0)