diff --git a/libs/ardour/session_command.cc b/libs/ardour/session_command.cc index cf9cd6f7c9..828daf37bb 100644 --- a/libs/ardour/session_command.cc +++ b/libs/ardour/session_command.cc @@ -103,7 +103,9 @@ Session::memento_command_factory(XMLNode *n) return new MementoCommand(*(pl.get()), before, after); } } else if (obj_T == typeid (Route).name() || obj_T == typeid (AudioTrack).name() || obj_T == typeid(MidiTrack).name()) { - return new MementoCommand(*route_by_id(id), before, after); + if (boost::shared_ptr r = route_by_id(id)) { + return new MementoCommand(*r, before, after); + } } else if (obj_T == typeid (Evoral::Curve).name() || obj_T == typeid (AutomationList).name()) { std::map::iterator i = automation_lists.find(id); if (i != automation_lists.end()) {