From 2ffb58a7e2b4f505cdb297345a2861425e060866 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 10 May 2023 11:25:53 -0700 Subject: [PATCH] Test for schematic type when changing The schematic editor undo list may hold page layout types as well --- eeschema/sch_edit_frame.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index f11436905b..5126d95c68 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1699,11 +1699,16 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags ) for( unsigned ii = 0; ii < changed_list->GetCount(); ++ii ) { - SCH_ITEM* item = static_cast( changed_list->GetPickedItem( ii ) ); + EDA_ITEM* item = changed_list->GetPickedItem( ii ); - std::vector tmp_pts = item->GetConnectionPoints(); + if( !item || !IsEeschemaType( item->Type() ) ) + continue; + + SCH_ITEM* sch_item = static_cast( item ); + + std::vector tmp_pts = sch_item->GetConnectionPoints(); pts.insert( pts.end(), tmp_pts.begin(), tmp_pts.end() ); - changed_items.insert( item ); + changed_items.insert( sch_item ); } for( VECTOR2I& pt: pts )