Protect against null pointer

Fixes #16172
https://gitlab.com/kicad/code/kicad/-/issues/16172
This commit is contained in:
jean-pierre charras 2023-11-27 09:52:18 +01:00
parent 998a03f005
commit 15c7f224b3
1 changed files with 3 additions and 0 deletions

View File

@ -224,6 +224,9 @@ bool PNS_PCBNEW_RULE_RESOLVER::IsKeepout( const PNS::ITEM* aObstacle, const PNS:
auto checkKeepout = auto checkKeepout =
[]( const ZONE* aKeepout, const BOARD_ITEM* aOther ) []( const ZONE* aKeepout, const BOARD_ITEM* aOther )
{ {
if( !aOther )
return false;
if( aKeepout->GetDoNotAllowTracks() && aOther->IsType( { PCB_ARC_T, PCB_TRACE_T } ) ) if( aKeepout->GetDoNotAllowTracks() && aOther->IsType( { PCB_ARC_T, PCB_TRACE_T } ) )
return true; return true;