mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Avoid assertion when changing projects
If the regex does not compile, we should not be checking for matches
This commit is contained in:
parent
8fea4812f3
commit
9077c9fb80
@ -432,10 +432,8 @@ wxTreeItemId PROJECT_TREE_PANE::addItemToProjectTree( const wxString& aName,
|
||||
if( ext == wxT( "" ) )
|
||||
continue;
|
||||
|
||||
reg.Compile( wxString::FromAscii( "^.*\\." ) + ext + wxString::FromAscii( "$" ),
|
||||
wxRE_ICASE );
|
||||
|
||||
if( reg.Matches( aName ) )
|
||||
if( reg.Compile( wxString::FromAscii( "^.*\\." ) + ext + wxString::FromAscii( "$" ),
|
||||
wxRE_ICASE ) && reg.Matches( aName ) )
|
||||
{
|
||||
type = (TREE_FILE_TYPE) i;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user