Fix null-dereference in libedit
Clearing the CurPart sets to null. Need to keep datasheet checks behind guards
This commit is contained in:
parent
31e38f2fd4
commit
7dd9304d24
|
@ -381,8 +381,12 @@ void LIB_EDIT_FRAME::SetCurPart( LIB_PART* aPart )
|
|||
delete m_my_part;
|
||||
m_my_part = aPart;
|
||||
|
||||
// Datasheet field is special; copy it to the root alias docfilename
|
||||
m_my_part->GetField( DATASHEET )->SetText( aPart->GetRootAlias()->GetDocFileName() );
|
||||
// Datasheet field is special; copy it to the root alias docfilename but watch out
|
||||
// for clearing the aPart
|
||||
if( m_my_part )
|
||||
{
|
||||
m_my_part->GetField( DATASHEET )->SetText( aPart->GetRootAlias()->GetDocFileName() );
|
||||
}
|
||||
}
|
||||
|
||||
// select the current component in the tree widget
|
||||
|
|
Loading…
Reference in New Issue