From c0287cb0dea07aa1a4cbd38dfdfd1c5dcc840600 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 9 Sep 2023 21:25:53 +0200 Subject: [PATCH] Fix thinko in e81b2353cc1, 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. --- gtk2_ardour/editor.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 142c886e98..7d8f346d4b 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1608,10 +1608,9 @@ Editor::popup_section_box_menu (int button, int32_t time) #endif 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 () */ - Location* l = _session->locations ()->mark_at (start); - assert (l); LocationMarkers* lm = find_location_markers (l); assert (lm && lm->start); items.push_back (SeparatorElem());