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();
|
PICKED_ITEMS_LIST* lastUndo = PopCommandFromUndoList();
|
||||||
|
|
||||||
// If the last stack was empty, use that one instead of creating a new stack
|
// If the last stack was empty, use that one instead of creating a new stack
|
||||||
if( aAppend || !lastUndo->GetCount() )
|
if( lastUndo )
|
||||||
commandToUndo = lastUndo;
|
{
|
||||||
else
|
if( aAppend || !lastUndo->GetCount() )
|
||||||
PushCommandToUndoList( lastUndo );
|
commandToUndo = lastUndo;
|
||||||
|
else
|
||||||
|
PushCommandToUndoList( lastUndo );
|
||||||
|
}
|
||||||
|
|
||||||
if( !commandToUndo )
|
if( !commandToUndo )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue