Don't update file browser filter if control doesn't exist
When the grid is being validated, SetValue is called, which then ends up running the file filter update. However, if the cell was never selected, the file browser button would never have been created. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16316
This commit is contained in:
parent
0db362a907
commit
d8bb9b1e66
|
@ -508,8 +508,8 @@ void GRID_CELL_PATH_EDITOR::UpdateFilterString( const wxString& aFilterString )
|
|||
m_fileFilter = aFilterString;
|
||||
|
||||
// Ensure that the control switches between files and directories properly
|
||||
if( m_fileFilter.IsEmpty() )
|
||||
static_cast<TEXT_BUTTON_FILE_BROWSER*>( m_control )->UpdateFileFilter( nullptr );
|
||||
else
|
||||
static_cast<TEXT_BUTTON_FILE_BROWSER*>( m_control )->UpdateFileFilter( &m_fileFilter );
|
||||
TEXT_BUTTON_FILE_BROWSER* button = dynamic_cast<TEXT_BUTTON_FILE_BROWSER*>( m_control );
|
||||
|
||||
if( button )
|
||||
button->UpdateFileFilter( m_fileFilter.IsEmpty() ? nullptr : &m_fileFilter );
|
||||
}
|
Loading…
Reference in New Issue