Footprint editor: fix a crash when trying to edit the properties of a footprint not yet in tree (i.e. imported from file)
(cherry picked from commit cee1873fff
)
Fixes: lp:1850497
* https://bugs.launchpad.net/kicad/+bug/1850497
This commit is contained in:
parent
88a03f1a1d
commit
fb9b12a982
|
@ -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<LIB_TREE_NODE_LIB_ID*>( 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<LIB_TREE_NODE_LIB_ID*>( treeItem.GetID() )->Update( &footprintInfo );
|
||||
m_treePane->GetLibTree()->Refresh();
|
||||
}
|
||||
|
||||
updateTitle(); // in case of a name change...
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue