Eeschema: fix a crash when closing the choose component dialog by OK button, if no component selected.
This commit is contained in:
parent
61c2beea22
commit
cfac7bd31c
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue