EasyEDA Std PCB: fix crash when Name/Prefix type text is not in a footprint.

(cherry picked from commit 951c550c1e)
This commit is contained in:
Alex Shvartzkop 2024-03-04 15:04:02 +03:00
parent 46faa0f678
commit 4ac848f18a
1 changed files with 2 additions and 2 deletions

View File

@ -789,11 +789,11 @@ void PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer(
wxString textType = arr[1];
bool add = false;
if( textType == wxS( "P" ) )
if( footprint && textType == wxS( "P" ) )
{
text = footprint->GetField( REFERENCE_FIELD );
}
else if( textType == wxS( "N" ) )
else if( footprint && textType == wxS( "N" ) )
{
text = footprint->GetField( VALUE_FIELD );
}