summaryrefslogtreecommitdiff
path: root/libs/ardour/session_command.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-06-09 21:17:12 +0000
committerDavid Robillard <d@drobilla.net>2009-06-09 21:17:12 +0000
commit318fb3a0694c6a3533cd6068069b3417c74c39e0 (patch)
tree1afe4eefa6c55f3573f3901b2a772a4b42ca6b64 /libs/ardour/session_command.cc
parent75884ab43d510d6caf50bc76de2deb4564c8490b (diff)
Fix crash when loading broken sessions with invalid route IDs.
git-svn-id: svn://localhost/ardour2/branches/3.0@5139 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_command.cc')
-rw-r--r--libs/ardour/session_command.cc4
1 files changed, 3 insertions, 1 deletions
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<Playlist>(*(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>(*route_by_id(id), before, after);
+ if (boost::shared_ptr<Route> r = route_by_id(id)) {
+ return new MementoCommand<Route>(*r, before, after);
+ }
} else if (obj_T == typeid (Evoral::Curve).name() || obj_T == typeid (AutomationList).name()) {
std::map<PBD::ID, AutomationList*>::iterator i = automation_lists.find(id);
if (i != automation_lists.end()) {