Nullptr defensive code.
Fixes https://gitlab.com/kicad/code/kicad/issues/11690
This commit is contained in:
parent
4f3cfdc92e
commit
9b70308f5c
|
@ -247,7 +247,11 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
|
||||||
|
|
||||||
id.SetLibNickname( getCurNickname() );
|
id.SetLibNickname( getCurNickname() );
|
||||||
id.SetLibItemName( getCurFootprintName() );
|
id.SetLibItemName( getCurFootprintName() );
|
||||||
GetBoard()->Add( loadFootprint( id ) );
|
|
||||||
|
FOOTPRINT* footprint = loadFootprint( id );
|
||||||
|
|
||||||
|
if( footprint )
|
||||||
|
GetBoard()->Add( footprint );
|
||||||
}
|
}
|
||||||
|
|
||||||
drawPanel->DisplayBoard( m_pcb );
|
drawPanel->DisplayBoard( m_pcb );
|
||||||
|
|
|
@ -441,6 +441,8 @@ int FOOTPRINT_EDITOR_CONTROL::RenameFootprint( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
footprint = m_frame->LoadFootprint( fpID );
|
footprint = m_frame->LoadFootprint( fpID );
|
||||||
|
|
||||||
|
if( footprint )
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
footprint->SetFPID( LIB_ID( libraryName, newName ) );
|
footprint->SetFPID( LIB_ID( libraryName, newName ) );
|
||||||
|
@ -461,6 +463,7 @@ int FOOTPRINT_EDITOR_CONTROL::RenameFootprint( const TOOL_EVENT& aEvent )
|
||||||
// Best efforts...
|
// Best efforts...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wxDataViewItem treeItem = m_frame->GetLibTreeAdapter()->FindItem( fpID );
|
wxDataViewItem treeItem = m_frame->GetLibTreeAdapter()->FindItem( fpID );
|
||||||
m_frame->UpdateLibraryTree( treeItem, footprint );
|
m_frame->UpdateLibraryTree( treeItem, footprint );
|
||||||
|
|
Loading…
Reference in New Issue