summaryrefslogtreecommitdiff
path: root/libs/ardour/session_command.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-01-17 03:16:41 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-01-17 03:16:41 +0000
commit255a697c44953bcac441ff699cc953b6b0b7baf8 (patch)
treee67a1c9a08de746427057a39bac23a20ed2e908a /libs/ardour/session_command.cc
parentfd62d7aa3c2df966e4284cad7dcee2acb57f4009 (diff)
don't crash if history refers to a location that no longer exists
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2929 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_command.cc')
-rw-r--r--libs/ardour/session_command.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/ardour/session_command.cc b/libs/ardour/session_command.cc
index b9a0e2cb60..687e10f789 100644
--- a/libs/ardour/session_command.cc
+++ b/libs/ardour/session_command.cc
@@ -86,7 +86,10 @@ Session::memento_command_factory(XMLNode *n)
if (audio_sources.count(id))
return new MementoCommand<AudioSource>(*audio_sources[id], before, after);
} else if (obj_T == typeid (Location).name()) {
- return new MementoCommand<Location>(*_locations.get_location_by_id(id), before, after);
+ Location* loc = _locations.get_location_by_id(id);
+ if (loc) {
+ return new MementoCommand<Location>(*loc, before, after);
+ }
} else if (obj_T == typeid (Locations).name()) {
return new MementoCommand<Locations>(_locations, before, after);
} else if (obj_T == typeid (TempoMap).name()) {