From 62fd7340070fefdc81a31b2212e53ec7145d16ea Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 22 Mar 2018 11:37:54 +0100 Subject: [PATCH] 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. --- pcbnew/footprint_viewer_frame.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 72dc717cc1..475b1a013b 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -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() );