Footprint Viewer: do not try to preselect an empty footprint

Empty string is treated as an invalid LIB_ID, so it ends up with an
exception.
This commit is contained in:
Maciej Suminski 2018-03-22 11:37:54 +01:00
parent 351fc0c343
commit 62fd734007
1 changed files with 2 additions and 1 deletions

View File

@ -624,9 +624,10 @@ void FOOTPRINT_VIEWER_FRAME::OnActivate( wxActivateEvent& event )
bool FOOTPRINT_VIEWER_FRAME::ShowModal( wxString* aFootprint, wxWindow* aResultantFocusWindow )
{
if( aFootprint )
if( aFootprint && !aFootprint->IsEmpty() )
{
LIB_ID fpid( *aFootprint );
if( fpid.IsValid() )
{
setCurNickname( fpid.GetLibNickname() );