Commit 028b0bd3 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Fix board parsing error when module name is empty. (fixes lp:1226546)

parent 0224bc2f
......@@ -1540,6 +1540,7 @@ MODULE* PCB_PARSER::parseMODULE( wxArrayString* aInitialComments ) throw( IO_ERR
wxCHECK_MSG( CurTok() == T_module, NULL,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as MODULE." ) );
wxString name;
wxPoint pt;
T token;
FPID fpid;
......@@ -1549,8 +1550,9 @@ MODULE* PCB_PARSER::parseMODULE( wxArrayString* aInitialComments ) throw( IO_ERR
module->SetInitialComments( aInitialComments );
NeedSYMBOLorNUMBER();
name = FromUTF8();
if( fpid.Parse( FromUTF8() ) >= 0 )
if( !name.IsEmpty() && fpid.Parse( FromUTF8() ) >= 0 )
{
wxString error;
error.Printf( _( "invalid PFID in\nfile: <%s>\nline: %d\noffset: %d" ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment