Fix issue: "Malformed footprint causes crash on load" (in fact, no crash: just an assert dialog is shown)

This commit is contained in:
jean-pierre charras
2016-03-13 16:39:18 +01:00
parent 3ba4226cb2
commit 44fc6cb337
2 changed files with 13 additions and 7 deletions
+7 -1
View File
@@ -1692,7 +1692,13 @@ MODULE* PCB_PARSER::parseMODULE( wxArrayString* aInitialComments ) throw( IO_ERR
break;
case T_layer:
module->SetLayer( parseBoardItemLayer() );
{
// Footprints can be only on the front side or the back side.
// but because we can find some stupid layer in file, ensure a
// acceptable layer is set for the footprint
LAYER_ID layer = parseBoardItemLayer();
module->SetLayer( layer == B_Cu ? B_Cu : F_Cu );
}
NeedRIGHT();
break;