Eeschema: fix a crash after reopening the ERC dialog, after changes in schematic.

When the ERC is run and a component has a ERC error linked to it, if it is deleted,
when reopening the ERC dialog, the dialog crashed due to a not found item
(null pointer use)
This commit is contained in:
jean-pierre charras 2020-06-01 18:56:21 +02:00
parent 21c752fa0b
commit 59523efc1a
1 changed files with 8 additions and 2 deletions

View File

@ -270,7 +270,10 @@ void RC_TREE_MODEL::GetValue( wxVariant& aVariant,
{
EDA_ITEM* item = m_editFrame->GetItem( rcItem->GetMainItemID() );
aVariant = item->GetSelectMenuText( m_editFrame->GetUserUnits() );
if( item )
aVariant = item->GetSelectMenuText( m_editFrame->GetUserUnits() );
else
aVariant = _( "item not found (Please, rerun ERC)" );
}
break;
@ -278,7 +281,10 @@ void RC_TREE_MODEL::GetValue( wxVariant& aVariant,
{
EDA_ITEM* item = m_editFrame->GetItem( rcItem->GetAuxItemID() );
aVariant = item->GetSelectMenuText( m_editFrame->GetUserUnits() );
if( item )
aVariant = item->GetSelectMenuText( m_editFrame->GetUserUnits() );
else
aVariant = _( "item not found (Please, rerun ERC)" );
}
break;
}