PNS: Protect drag from null deref
Items that do not have nets will not be in the index, so we need to avoid the null pointer when adding drag tagets Fixes https://gitlab.com/kicad/code/kicad/issues/4009
This commit is contained in:
parent
44b8bb8f60
commit
f6317fba82
|
@ -1444,9 +1444,12 @@ ITEM *NODE::FindItemByParent( const BOARD_CONNECTED_ITEM* aParent )
|
|||
{
|
||||
INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( aParent->GetNetCode() );
|
||||
|
||||
for( ITEM*item : *l_cur )
|
||||
if( item->Parent() == aParent )
|
||||
return item;
|
||||
if( l_cur )
|
||||
{
|
||||
for( ITEM* item : *l_cur )
|
||||
if( item->Parent() == aParent )
|
||||
return item;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue