diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index ca64d4a57d..6c27e914b7 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -350,8 +350,13 @@ void FOOTPRINT_EDIT_FRAME::editFootprintProperties( MODULE* aModule ) // Update library tree BASIC_FOOTPRINT_INFO footprintInfo( aModule ); wxDataViewItem treeItem = m_adapter->FindItem( oldFPID ); - static_cast( treeItem.GetID() )->Update( &footprintInfo ); - m_treePane->GetLibTree()->Refresh(); + + if( treeItem.IsOk() ) // Can be not found in tree if the current footprint is imported from file + // therefore not yet in tree. + { + static_cast( treeItem.GetID() )->Update( &footprintInfo ); + m_treePane->GetLibTree()->Refresh(); + } updateTitle(); // in case of a name change...