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
+6 -6
View File
@@ -1,10 +1,10 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
* Copyright (C) 2015 Wayne Stambaugh <[email protected]>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -900,6 +900,10 @@ void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
switch( m_Layer )
{
default:
wxASSERT_MSG( false, "Illegal layer" ); // do you really have modules placed on other layers?
// pass through
case F_Cu:
aLayers[1] = ITEM_GAL_LAYER( MOD_FR_VISIBLE );
break;
@@ -907,10 +911,6 @@ void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
case B_Cu:
aLayers[1] = ITEM_GAL_LAYER( MOD_BK_VISIBLE );
break;
default:
assert( false ); // do you really have modules placed on inner layers?
break;
}
}