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