eeschema: Testing for static/dynamic cast failure
This commit is contained in:
parent
132adf8ac3
commit
92011d91d2
|
@ -902,6 +902,9 @@ int SCH_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
|
SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
|
||||||
|
|
||||||
|
if( !sch_item )
|
||||||
|
continue;
|
||||||
|
|
||||||
if( sch_item->Type() == SCH_JUNCTION_T )
|
if( sch_item->Type() == SCH_JUNCTION_T )
|
||||||
{
|
{
|
||||||
sch_item->SetFlags( STRUCT_DELETED );
|
sch_item->SetFlags( STRUCT_DELETED );
|
||||||
|
|
|
@ -866,10 +866,10 @@ int SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
for( unsigned ii = 0; ii < aSelection->GetSize(); ii++ )
|
for( unsigned ii = 0; ii < aSelection->GetSize(); ii++ )
|
||||||
{
|
{
|
||||||
SCH_ITEM* item = static_cast<SCH_ITEM*>( aSelection->GetItem( ii ) );
|
SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( aSelection->GetItem( ii ) );
|
||||||
std::vector<wxPoint> new_pts;
|
std::vector<wxPoint> new_pts;
|
||||||
|
|
||||||
if( !item->IsConnectable() )
|
if( !item || !item->IsConnectable() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
item->GetConnectionPoints( new_pts );
|
item->GetConnectionPoints( new_pts );
|
||||||
|
|
Loading…
Reference in New Issue