From a6f85b0da4c21ef135697e74b09f5232f82bc8f1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 20 Nov 2025 15:33:30 -0700 Subject: [PATCH] EditingContext: use a correct check for various MIDI-only actions --- gtk2_ardour/editing_context.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/editing_context.cc b/gtk2_ardour/editing_context.cc index be9ef3de92..270b0ca049 100644 --- a/gtk2_ardour/editing_context.cc +++ b/gtk2_ardour/editing_context.cc @@ -428,15 +428,15 @@ EditingContext::set_action_defaults () grid_actions[Editing::GridTypeBeat]->set_active (false); grid_actions[Editing::GridTypeBeat]->set_active (true); } - if (draw_length_actions[DRAW_LEN_AUTO]) { + if (draw_length_actions.find (DRAW_LEN_AUTO) != draw_length_actions.end()) { draw_length_actions[DRAW_LEN_AUTO]->set_active (false); draw_length_actions[DRAW_LEN_AUTO]->set_active (true); } - if (draw_velocity_actions[DRAW_VEL_AUTO]) { + if (draw_velocity_actions.find (DRAW_VEL_AUTO) != draw_velocity_actions.end()) { draw_velocity_actions[DRAW_VEL_AUTO]->set_active (false); draw_velocity_actions[DRAW_VEL_AUTO]->set_active (true); } - if (draw_channel_actions[DRAW_CHAN_AUTO]) { + if (draw_channel_actions.find (DRAW_CHAN_AUTO) != draw_channel_actions.end()) { draw_channel_actions[DRAW_CHAN_AUTO]->set_active (false); draw_channel_actions[DRAW_CHAN_AUTO]->set_active (true); } @@ -1144,7 +1144,9 @@ EditingContext::set_draw_length (GridType gt) { EC_LOCAL_TEMPO_SCOPE; - draw_length_actions[gt]->set_active (true); + if (draw_length_actions.find (gt) != draw_length_actions.end() && draw_length_actions[gt]) { + draw_length_actions[gt]->set_active (true); + } } void