From: Paul Davis Date: Thu, 17 Jan 2008 03:16:41 +0000 (+0000) Subject: don't crash if history refers to a location that no longer exists X-Git-Tag: 2.8.16~1689 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=255a697c44953bcac441ff699cc953b6b0b7baf8;hp=fd62d7aa3c2df966e4284cad7dcee2acb57f4009;p=ardour.git 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 --- 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(*audio_sources[id], before, after); } else if (obj_T == typeid (Location).name()) { - return new MementoCommand(*_locations.get_location_by_id(id), before, after); + Location* loc = _locations.get_location_by_id(id); + if (loc) { + return new MementoCommand(*loc, before, after); + } } else if (obj_T == typeid (Locations).name()) { return new MementoCommand(_locations, before, after); } else if (obj_T == typeid (TempoMap).name()) {