diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2018-02-09 13:43:20 -0600 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2018-02-09 13:43:20 -0600 |
commit | 5e24b1747866543973ac1883387e8ac6dcf92940 (patch) | |
tree | c926756cbf591aa3afc1ddecc0317b4e7faf89d4 /gtk2_ardour | |
parent | 913445c9815646c7b9e9909d109722cf9b8c88a6 (diff) |
Fix potential crash with EditAtSelectedMarker, when no marker is selected.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index ba9f9d1a74..36d9a809d2 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -5766,10 +5766,12 @@ Editor::super_rapid_screen_update () } else if ( _edit_point == EditAtSelectedMarker ) { //NOTE: I don't think EditAtSelectedMarker should snap. they are what they are. //however, the current editing code -does- snap so I'll draw it that way for now. - MusicSample ms (selection->markers.front()->position(), 0); - snap_to (ms); // should use snap_to_with_modifier? - snapped_cursor->set_position ( ms.sample ); - snapped_cursor->show (); + if ( !selection->markers.empty() ) { + MusicSample ms (selection->markers.front()->position(), 0); + snap_to (ms); // should use snap_to_with_modifier? + snapped_cursor->set_position ( ms.sample ); + snapped_cursor->show (); + } } else if (mouse_sample (where.sample, ignored)) { //cursor is in the editing canvas. show it. snapped_cursor->show (); } else { //mouse is out of the editing canvas. hide the snapped_cursor |