Pcbnew, footprint editor: fix crash due to a null pointer use

This commit is contained in:
jean-pierre charras 2023-07-14 15:13:17 +02:00
parent cbb8835c87
commit 3ac454153e
1 changed files with 5 additions and 1 deletions

View File

@ -1155,8 +1155,12 @@ void PCB_BASE_FRAME::setFPWatcher( FOOTPRINT* aFootprint )
if( !aFootprint )
{
wxLogTrace( "KICAD_LIB_WATCH", "Remove watch" );
m_watcher->RemoveAll();
if( m_watcher )
m_watcher->RemoveAll();
m_watcher.reset();
return;
}