fix crash when clicking on region view list column that has no region pointer associa...
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 21 May 2007 13:45:00 +0000 (13:45 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 21 May 2007 13:45:00 +0000 (13:45 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@1885 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_region_list.cc

index df23ac503cbc2dff44cb3056324461dc2b8ba68d..0ee77db58cdcaf90c26eb7d751059bb1190f37f0 100644 (file)
@@ -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<Region> 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);
+                       }
                }
        }
 }