Nullptr safety.

Fixes https://gitlab.com/kicad/code/kicad/issues/12966
This commit is contained in:
Jeff Young 2022-11-30 13:56:23 +00:00
parent 6dc1c9b0b7
commit 03f79f512c
1 changed files with 6 additions and 3 deletions

View File

@ -262,10 +262,13 @@ void BOARD::UpdateRatsnestExclusions()
GetConnectivity()->RunOnUnconnectedEdges(
[&]( CN_EDGE& aEdge )
{
std::pair<KIID, KIID> ids = { aEdge.GetSourceNode()->Parent()->m_Uuid,
aEdge.GetTargetNode()->Parent()->m_Uuid };
if( aEdge.GetSourceNode() && aEdge.GetTargetNode() )
{
std::pair<KIID, KIID> ids = { aEdge.GetSourceNode()->Parent()->m_Uuid,
aEdge.GetTargetNode()->Parent()->m_Uuid };
aEdge.SetVisible( m_ratsnestExclusions.count( ids ) == 0 );
aEdge.SetVisible( m_ratsnestExclusions.count( ids ) == 0 );
}
return true;
} );