Check that net is valid before dereferencing
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5325
This commit is contained in:
parent
9a0f956b92
commit
41f53cc138
|
@ -1845,9 +1845,11 @@ void APPEARANCE_CONTROLS::showNetclass( const wxString& aClassName, bool aShow )
|
||||||
|
|
||||||
for( const wxString& member : *netclass )
|
for( const wxString& member : *netclass )
|
||||||
{
|
{
|
||||||
int code = nets.GetNetItem( member )->GetNet();
|
if( NETINFO_ITEM* net = nets.GetNetItem( member ) )
|
||||||
manager->RunAction( action, true, code );
|
{
|
||||||
updateWidget( code );
|
manager->RunAction( action, true, net->GetNet() );
|
||||||
|
updateWidget( net->GetNet() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1967,6 +1969,9 @@ void APPEARANCE_CONTROLS::onNetclassContextMenu( wxCommandEvent& aEvent )
|
||||||
runOnNetsOfClass( netclass,
|
runOnNetsOfClass( netclass,
|
||||||
[&]( NETINFO_ITEM* aItem )
|
[&]( NETINFO_ITEM* aItem )
|
||||||
{
|
{
|
||||||
|
if( !aItem )
|
||||||
|
return;
|
||||||
|
|
||||||
static bool first = true;
|
static bool first = true;
|
||||||
int code = aItem->GetNet();
|
int code = aItem->GetNet();
|
||||||
|
|
||||||
|
@ -1996,6 +2001,9 @@ void APPEARANCE_CONTROLS::onNetclassContextMenu( wxCommandEvent& aEvent )
|
||||||
runOnNetsOfClass( netclass,
|
runOnNetsOfClass( netclass,
|
||||||
[&]( NETINFO_ITEM* aItem )
|
[&]( NETINFO_ITEM* aItem )
|
||||||
{
|
{
|
||||||
|
if( !aItem )
|
||||||
|
return;
|
||||||
|
|
||||||
int code = aItem->GetNet();
|
int code = aItem->GetNet();
|
||||||
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectNet, true,
|
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::selectNet, true,
|
||||||
code );
|
code );
|
||||||
|
|
Loading…
Reference in New Issue