App: [skip ci] fix possible segmentation fault when performing a transaction after an undo
App: [skip ci] fix possible segmentation fault when performing a transaction after an undo

Fat-Zer/FreeCAD_sf_master,Fat-Zer/FreeCAD_sf_master,Fat-Zer/FreeCAD_sf_master,Fat-Zer/FreeCAD_sf_master,Fat-Zer/FreeCAD_sf_master