Fix board parsing error when module name is empty. (fixes lp:1226546)
This commit is contained in:
parent
0224bc2f58
commit
028b0bd3f3
|
@ -1540,6 +1540,7 @@ MODULE* PCB_PARSER::parseMODULE( wxArrayString* aInitialComments ) throw( IO_ERR
|
||||||
wxCHECK_MSG( CurTok() == T_module, NULL,
|
wxCHECK_MSG( CurTok() == T_module, NULL,
|
||||||
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as MODULE." ) );
|
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as MODULE." ) );
|
||||||
|
|
||||||
|
wxString name;
|
||||||
wxPoint pt;
|
wxPoint pt;
|
||||||
T token;
|
T token;
|
||||||
FPID fpid;
|
FPID fpid;
|
||||||
|
@ -1549,8 +1550,9 @@ MODULE* PCB_PARSER::parseMODULE( wxArrayString* aInitialComments ) throw( IO_ERR
|
||||||
module->SetInitialComments( aInitialComments );
|
module->SetInitialComments( aInitialComments );
|
||||||
|
|
||||||
NeedSYMBOLorNUMBER();
|
NeedSYMBOLorNUMBER();
|
||||||
|
name = FromUTF8();
|
||||||
|
|
||||||
if( fpid.Parse( FromUTF8() ) >= 0 )
|
if( !name.IsEmpty() && fpid.Parse( FromUTF8() ) >= 0 )
|
||||||
{
|
{
|
||||||
wxString error;
|
wxString error;
|
||||||
error.Printf( _( "invalid PFID in\nfile: <%s>\nline: %d\noffset: %d" ),
|
error.Printf( _( "invalid PFID in\nfile: <%s>\nline: %d\noffset: %d" ),
|
||||||
|
|
Loading…
Reference in New Issue