commit: protect against un-copyable error

This creates early asserts for issues where we haven't fully implemented
a Clone() function for items or haven't correctly filtered them before
creating the undo/redo commit.
This commit is contained in:
Seth Hillbrand 2019-02-16 13:28:45 -08:00
parent d15876595f
commit c84752b9a7
1 changed files with 13 additions and 1 deletions

View File

@ -64,7 +64,19 @@ COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType )
case CHT_MODIFY:
{
EDA_ITEM* parent = parentObject( aItem );
return createModified( parent, parent->Clone(), flag );
EDA_ITEM* clone = nullptr;
assert( parent );
if( parent )
clone = parent->Clone();
assert( clone );
if( clone )
return createModified( parent, clone, flag );
break;
}
default: