From cfac7bd31cbb8470d698fd97e80309df711076e9 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 27 Mar 2017 08:53:19 +0200 Subject: [PATCH] Eeschema: fix a crash when closing the choose component dialog by OK button, if no component selected. --- eeschema/getpart.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp index 0057582495..ec5dff5307 100644 --- a/eeschema/getpart.cpp +++ b/eeschema/getpart.cpp @@ -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;