Check for NETINFO_ITEM before dereferencing it.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17230

(cherry picked from commit bd1d449cd3)
This commit is contained in:
Jeff Young 2024-03-02 11:36:38 +00:00
parent 3d67ab72c6
commit a0905ac87d
1 changed files with 2 additions and 1 deletions

View File

@ -6184,7 +6184,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