Fix crash parsing cadstar

Fixes sentry KICAD-B2
This commit is contained in:
Marek Roszko 2023-02-19 08:06:35 -05:00
parent c5a2c9c773
commit 30a49462fe
2 changed files with 2 additions and 2 deletions

View File

@ -193,7 +193,7 @@ void CADSTAR_ARCHIVE_PARSER::LINECODE::Parse( XNODE* aNode, PARSER_CONTEXT* aCon
XNODE* cNode = aNode->GetChildren();
if( cNode->GetName() != wxT( "STYLE" ) )
if( !cNode || cNode->GetName() != wxT( "STYLE" ) )
THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), wxString::Format( "LINECODE -> %s", Name ) );
wxString styleStr = GetXmlAttributeIDString( cNode, 0 );

View File

@ -1266,7 +1266,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::TEXTFORMAT::Parse( XNODE* aNode,
XNODE* cNode = aNode->GetChildren();
if( cNode->GetName() != wxT( "TXTSTYLE" ) )
if( !cNode || cNode->GetName() != wxT( "TXTSTYLE" ) )
THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), wxT( "DIMTEXT" ) );
wxString styleStr = GetXmlAttributeIDString( cNode, 0 );