Fix crashes with empty route-lists e.g. mute_release w/o routes
authorRobin Gareus <robin@gareus.org>
Sun, 16 Apr 2017 21:48:49 +0000 (23:48 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 16 Apr 2017 21:48:49 +0000 (23:48 +0200)
libs/ardour/ardour/utils.h

index cc6e5044cef0e017bc740f7c5a2752c9a6575cfc..b06f7f17a8e980a0b270d9cd92633037a4832ecf 100644 (file)
@@ -178,6 +178,7 @@ LIBARDOUR_API uint32_t how_many_dsp_threads ();
 
 template<typename T> boost::shared_ptr<ControlList> route_list_to_control_list (boost::shared_ptr<RouteList> rl, boost::shared_ptr<T> (Stripable::*get_control)() const) {
        boost::shared_ptr<ControlList> cl (new ControlList);
+       if (!rl) { return cl; }
        for (RouteList::const_iterator r = rl->begin(); r != rl->end(); ++r) {
                boost::shared_ptr<AutomationControl> ac = ((*r).get()->*get_control)();
                if (ac) {