Browse Source

Fix null-dereference in libedit

Clearing the CurPart sets to null.  Need to keep datasheet checks behind
guards
pull/15/head
Seth Hillbrand 6 years ago
parent
commit
7dd9304d24
  1. 8
      eeschema/libedit/lib_edit_frame.cpp

8
eeschema/libedit/lib_edit_frame.cpp

@ -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…
Cancel
Save