13
0

Fix thinko in e81b2353cc, selection may not start at a marker

This fixes a crash when selecting a section, and then changing
the time-selection. Previously it was assumed that the section
context menu can only be shown for sections. But it applies to
any time[line]-selection.
This commit is contained in:
Robin Gareus 2023-09-09 21:25:53 +02:00
parent d1cc71150f
commit c0287cb0de
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -1608,10 +1608,9 @@ Editor::popup_section_box_menu (int button, int32_t time)
#endif #endif
timepos_t start, end; timepos_t start, end;
if (get_selection_extents (start, end)) { Location* l;
if (get_selection_extents (start, end) && NULL != (l = _session->locations ()->mark_at (start))) {
/* add some items from build_marker_menu () */ /* add some items from build_marker_menu () */
Location* l = _session->locations ()->mark_at (start);
assert (l);
LocationMarkers* lm = find_location_markers (l); LocationMarkers* lm = find_location_markers (l);
assert (lm && lm->start); assert (lm && lm->start);
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());