diff options
-rw-r--r-- | libs/ardour/session.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 5605ac1e6c..51bef1202b 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2530,12 +2530,15 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, if (instrument) { for (RouteList::iterator r = new_routes.begin(); r != new_routes.end(); ++r) { PluginPtr plugin = instrument->load (*this); + if (!plugin) { + warning << "Failed to add Synth Plugin to newly created track." << endmsg; + continue; + } if (pset) { plugin->load_preset (*pset); } boost::shared_ptr<Processor> p (new PluginInsert (*this, plugin)); (*r)->add_processor (p, PreFader); - } } } @@ -2618,6 +2621,10 @@ Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name if (instrument) { for (RouteList::iterator r = ret.begin(); r != ret.end(); ++r) { PluginPtr plugin = instrument->load (*this); + if (!plugin) { + warning << "Failed to add Synth Plugin to newly created track." << endmsg; + continue; + } if (pset) { plugin->load_preset (*pset); } |