Eeschema: fix a crash when closing the choose component dialog by OK button, if no component selected.

This commit is contained in:
jean-pierre charras 2017-03-27 08:53:19 +02:00
parent 61c2beea22
commit cfac7bd31c
1 changed files with 3 additions and 0 deletions

View File

@ -163,6 +163,9 @@ SCH_BASE_FRAME::COMPONENT_SELECTION SCH_BASE_FRAME::SelectComponentFromLibrary(
COMPONENT_SELECTION sel;
LIB_ALIAS* const alias = dlg.GetSelectedAlias( &sel.Unit );
if( alias == nullptr ) // Dialog closed by OK button, but no symbol selected
return COMPONENT_SELECTION();
if( alias->GetPart()->IsMulti() && sel.Unit == 0 )
sel.Unit = 1;