mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Add some defensive code to prevent crash when no undo record is stacked.
Fixes: lp:1838843 * https://bugs.launchpad.net/kicad/+bug/1838843
This commit is contained in:
parent
5503727d3d
commit
b6b26b4e1e
@ -362,14 +362,17 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
|
||||
void SCH_EDIT_FRAME::RollbackSchematicFromUndo()
|
||||
{
|
||||
PICKED_ITEMS_LIST* undo = GetScreen()->PopCommandFromUndoList();
|
||||
PutDataInPreviousState( undo, false );
|
||||
|
||||
undo->ClearListAndDeleteItems();
|
||||
delete undo;
|
||||
if( undo )
|
||||
{
|
||||
PutDataInPreviousState( undo, false );
|
||||
undo->ClearListAndDeleteItems();
|
||||
delete undo;
|
||||
|
||||
SetSheetNumberAndCount();
|
||||
SetSheetNumberAndCount();
|
||||
|
||||
TestDanglingEnds();
|
||||
TestDanglingEnds();
|
||||
}
|
||||
|
||||
SyncView();
|
||||
GetCanvas()->Refresh();
|
||||
|
Loading…
x
Reference in New Issue
Block a user