Fix potential crash in pcbnew (if if a pad in a footprint in a mal-formed .pretty library contains a reference to a net)

This commit is contained in:
unknown 2015-07-29 20:55:56 +02:00 committed by jean-pierre charras
parent 21b98f40b7
commit 07ad6cb0bb
1 changed files with 1 additions and 1 deletions

View File

@ -2316,7 +2316,7 @@ D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent ) throw( IO_ERROR, PARSE_ERROR )
GetChars( CurSource() ), CurLineNumber(), CurOffset() )
);
NeedSYMBOLorNUMBER();
if( FromUTF8() != m_board->FindNet( pad->GetNetCode() )->GetNetname() )
if( m_board && FromUTF8() != m_board->FindNet( pad->GetNetCode() )->GetNetname() )
THROW_IO_ERROR(
wxString::Format( _( "invalid net ID in\nfile: <%s>\nline: %d\noffset: %d" ),
GetChars( CurSource() ), CurLineNumber(), CurOffset() )