From cc9ed077be02bc7102807aaa791076da0d87cd1f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 25 Jun 2012 21:19:21 +0000 Subject: [PATCH] Patch from johan_mattsson_m to be more graceful if there is an undo record which references a non-existant object; this shouldn't happen, of course, but there was a bug in some early betas which made it occur (#4920). git-svn-id: svn://localhost/ardour2/branches/3.0@12930 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/pbd/sequence_property.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/pbd/pbd/sequence_property.h b/libs/pbd/pbd/sequence_property.h index 3aeb83ce4e..b9d59724dd 100644 --- a/libs/pbd/pbd/sequence_property.h +++ b/libs/pbd/pbd/sequence_property.h @@ -32,6 +32,7 @@ #include "pbd/property_basics.h" #include "pbd/property_list.h" #include "pbd/stateful_diff_command.h" +#include "pbd/error.h" namespace PBD { @@ -199,9 +200,10 @@ class SequenceProperty : public PropertyBase for (XMLNodeList::const_iterator j = grandchildren.begin(); j != grandchildren.end(); ++j) { typename Container::value_type v = get_content_from_xml (**j); - assert (v); - - if ((*j)->name() == "Add") { + + if (!v) { + warning << "undo transaction references an unknown object" << endmsg; + } else if ((*j)->name() == "Add") { p->_changes.added.insert (v); } else if ((*j)->name() == "Remove") { p->_changes.removed.insert (v);