drc_rule.cpp: avoid crash with a incorrect (broken or too old?) drc_rule file.

The crash was due to a null pointer not tested.
This commit is contained in:
jean-pierre charras 2020-09-12 11:25:35 +02:00
parent a98ea2fb2e
commit 1aa38b8f82
1 changed files with 8 additions and 0 deletions

View File

@ -78,6 +78,14 @@ const DRC_CONSTRAINT* GetConstraint( const BOARD_ITEM* aItem, const BOARD_ITEM*
}
else
{
if( !rule->m_Condition )
{
if( aReporter )
aReporter->Report( _( "No condition found; rule not applied." ) );
return nullptr;
}
if( aReporter )
{
aReporter->Report( wxString::Format( _( "Checking rule condition \"%s\"." ),