Nullptr defensive code.

Fixes https://gitlab.com/kicad/code/kicad/issues/11690

(cherry picked from commit 9b70308f5c)
This commit is contained in:
Jeff Young 2022-06-11 22:28:42 +01:00
parent 16d63b7772
commit 54c68080f5
1 changed files with 5 additions and 1 deletions

View File

@ -247,7 +247,11 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
id.SetLibNickname( getCurNickname() );
id.SetLibItemName( getCurFootprintName() );
GetBoard()->Add( loadFootprint( id ) );
FOOTPRINT* footprint = loadFootprint( id );
if( footprint )
GetBoard()->Add( footprint );
}
drawPanel->DisplayBoard( m_pcb );