13
0

Fix bug #6337, clicking in canvas without session loaded causes crash

This commit is contained in:
Tim Mayberry 2015-08-14 16:04:24 +10:00
parent c342769925
commit 07dc805919
2 changed files with 5 additions and 1 deletions

View File

@ -3291,6 +3291,10 @@ CursorDrag::CursorDrag (Editor* e, EditorCursor& c, bool s)
void
CursorDrag::fake_locate (framepos_t t)
{
if (_editor->session () == 0) {
return;
}
_editor->playhead_cursor->set_position (t);
Session* s = _editor->session ();

View File

@ -1139,7 +1139,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
}
//not rolling, range mode click + join_play_range : locate the PH here
if ( !_drags->active () && !_session->transport_rolling() && ( effective_mouse_mode() == MouseRange ) && ARDOUR_UI::config()->get_follow_edits() ) {
if ( !_drags->active () && _session && !_session->transport_rolling() && ( effective_mouse_mode() == MouseRange ) && ARDOUR_UI::config()->get_follow_edits() ) {
framepos_t where = canvas_event_sample (event);
snap_to(where);
_session->request_locate (where, false);