Fix crash with empty undo stack
This commit is contained in:
parent
e06aa32780
commit
4f1592e5c1
|
@ -117,10 +117,13 @@ void SCH_EDIT_FRAME::SaveCopyInUndoList( SCH_SCREEN* aScreen,
|
|||
PICKED_ITEMS_LIST* lastUndo = PopCommandFromUndoList();
|
||||
|
||||
// If the last stack was empty, use that one instead of creating a new stack
|
||||
if( lastUndo )
|
||||
{
|
||||
if( aAppend || !lastUndo->GetCount() )
|
||||
commandToUndo = lastUndo;
|
||||
else
|
||||
PushCommandToUndoList( lastUndo );
|
||||
}
|
||||
|
||||
if( !commandToUndo )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue