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( lastUndo )
|
||||||
|
{
|
||||||
if( aAppend || !lastUndo->GetCount() )
|
if( aAppend || !lastUndo->GetCount() )
|
||||||
commandToUndo = lastUndo;
|
commandToUndo = lastUndo;
|
||||||
else
|
else
|
||||||
PushCommandToUndoList( lastUndo );
|
PushCommandToUndoList( lastUndo );
|
||||||
|
}
|
||||||
|
|
||||||
if( !commandToUndo )
|
if( !commandToUndo )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue