Browse Source

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.
pull/13/head
Seth Hillbrand 7 years ago
parent
commit
c84752b9a7
  1. 14
      common/commit.cpp

14
common/commit.cpp

@ -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:

Loading…
Cancel
Save