diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index bd23fb0020..21427e1be1 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -854,8 +854,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... }