Add missing null check to library viewer control tool
This commit is contained in:
parent
34bc0a4e96
commit
33a40e788b
|
@ -373,9 +373,11 @@ int LIB_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent )
|
|||
else
|
||||
{
|
||||
part = viewFrame->GetSelectedSymbol();
|
||||
libId = part->GetLibId();
|
||||
unit = viewFrame->GetUnit();
|
||||
convert = viewFrame->GetConvert();
|
||||
|
||||
if( part )
|
||||
libId = part->GetLibId();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -389,7 +391,7 @@ int LIB_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent )
|
|||
return 0;
|
||||
}
|
||||
|
||||
SCH_COMPONENT* comp = new SCH_COMPONENT( *part, libId,g_CurrentSheet, unit, convert );
|
||||
SCH_COMPONENT* comp = new SCH_COMPONENT( *part, libId, g_CurrentSheet, unit, convert );
|
||||
|
||||
// Be sure the link to the corresponding LIB_PART is OK:
|
||||
comp->Resolve( *m_frame->Prj().SchSymbolLibTable() );
|
||||
|
|
Loading…
Reference in New Issue