Fix crash with empty undo stack

This commit is contained in:
Seth Hillbrand 2021-02-13 06:41:10 -08:00
parent e06aa32780
commit 4f1592e5c1
1 changed files with 7 additions and 4 deletions

View File

@ -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( aAppend || !lastUndo->GetCount() )
commandToUndo = lastUndo;
else
PushCommandToUndoList( lastUndo );
if( lastUndo )
{
if( aAppend || !lastUndo->GetCount() )
commandToUndo = lastUndo;
else
PushCommandToUndoList( lastUndo );
}
if( !commandToUndo )
{