From 84d2b0a5b08debfd9cc53d75147437acda1f30ba Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 21 May 2007 13:45:00 +0000 Subject: [PATCH] fix crash when clicking on region view list column that has no region pointer associated with it git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@1885 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_region_list.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/editor_region_list.cc b/gtk2_ardour/editor_region_list.cc index df23ac503c..0ee77db58c 100644 --- a/gtk2_ardour/editor_region_list.cc +++ b/gtk2_ardour/editor_region_list.cc @@ -231,12 +231,19 @@ Editor::region_list_selection_changed() TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); TreeIter iter; - /* just set the first selected region (in fact, the selection model might be SINGLE, which - means there can only be one. - */ - if ((iter = region_list_model->get_iter (*i))) { - set_selected_regionview_from_region_list (((*iter)[region_list_columns.region]), Selection::Set); + boost::shared_ptr r = (*iter)[region_list_columns.region]; + + /* they could have clicked on a row that is just a placeholder, like "Hidden" */ + + if (r) { + + /* just set the first selected region (in fact, the selection model might be SINGLE, which + means there can only be one. + */ + + set_selected_regionview_from_region_list (r, Selection::Set); + } } } }