Fixed a crash when trying to highlight a not existing component

This commit is contained in:
Maciej Suminski 2018-12-27 13:45:41 +01:00
parent f6e6ac3162
commit bce4a45ab4
1 changed files with 6 additions and 3 deletions

View File

@ -235,9 +235,12 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
SetStatusText( msg ); SetStatusText( msg );
if( foundItem )
{
// highlight selection // highlight selection
GetCanvas()->GetView()->HighlightItem( foundItem, pin ); GetCanvas()->GetView()->HighlightItem( foundItem, pin );
GetCanvas()->Refresh(); GetCanvas()->Refresh();
}
return item; return item;
} }