Fix crash on opening route menu with busses in the selection.
authorCarl Hetherington <carl@carlh.net>
Thu, 24 Feb 2011 00:05:28 +0000 (00:05 +0000)
committerCarl Hetherington <carl@carlh.net>
Thu, 24 Feb 2011 00:05:28 +0000 (00:05 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8945 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/route_time_axis.cc

index 94b85f78768d6737ee3537b5d9b2cb4925da490a..1730725fe74f38c8975bf18f6146d22ea6a28b56 100644 (file)
@@ -524,7 +524,7 @@ RouteTimeAxisView::build_display_menu ()
                        TrackSelection const & s = _editor.get_selection().tracks;
                        for (TrackSelection::const_iterator i = s.begin(); i != s.end(); ++i) {
                                RouteTimeAxisView* r = dynamic_cast<RouteTimeAxisView*> (*i);
-                               if (!r) {
+                               if (!r || !r->is_track ()) {
                                        continue;
                                }
                                
@@ -961,7 +961,9 @@ RouteTimeAxisView::set_align_style (AlignStyle style, bool apply_to_selection)
        if (apply_to_selection) {
                _editor.get_selection().tracks.foreach_route_time_axis (boost::bind (&RouteTimeAxisView::set_align_style, _1, style, false));
        } else {
-               track()->set_align_style (style);
+               if (track ()) {
+                       track()->set_align_style (style);
+               }
        }
 }