Check for NETINFO_ITEM before dereferencing it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17230
This commit is contained in:
Jeff Young 2024-03-02 11:36:38 +00:00
parent 1ee49cca5e
commit bd1d449cd3
1 changed files with 2 additions and 1 deletions

View File

@ -6464,7 +6464,8 @@ ZONE* PCB_IO_KICAD_SEXPR_PARSER::parseZONE( BOARD_ITEM_CONTAINER* aParent )
zone->SetNetCode( NETINFO_LIST::UNCONNECTED );
// Ensure the zone net name is valid, and matches the net code, for copper zones
if( zone_has_net && ( zone->GetNet()->GetNetname() != netnameFromfile ) )
if( zone_has_net
&& ( !zone->GetNet() || zone->GetNet()->GetNetname() != netnameFromfile ) )
{
// Can happens which old boards, with nonexistent nets ...
// or after being edited by hand