Don't dereference NULL when checking current part.
This commit is contained in:
parent
a958b23a11
commit
d6ac303a8c
|
@ -575,20 +575,24 @@ void LIB_EDIT_FRAME::OnRevert( wxCommandEvent& aEvent )
|
||||||
if( !ConfirmRevertDialog( this, msg ) )
|
if( !ConfirmRevertDialog( this, msg ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool reload_currentPart;
|
bool reload_currentPart = false;
|
||||||
wxString curr_partName = partName;
|
wxString curr_partName = partName;
|
||||||
|
|
||||||
// the library itself is reverted: the current part will be reloaded only if it is owned by this library
|
if( GetCurPart() )
|
||||||
if( partName.IsEmpty() )
|
|
||||||
{
|
{
|
||||||
LIB_ID curr_libId = GetCurPart()->GetLibId();
|
// the library itself is reverted: the current part will be reloaded only if it is
|
||||||
reload_currentPart = libName == curr_libId.GetLibNickname();
|
// owned by this library
|
||||||
|
if( partName.IsEmpty() )
|
||||||
|
{
|
||||||
|
LIB_ID curr_libId = GetCurPart()->GetLibId();
|
||||||
|
reload_currentPart = libName == curr_libId.GetLibNickname();
|
||||||
|
|
||||||
if( reload_currentPart )
|
if( reload_currentPart )
|
||||||
curr_partName = curr_libId.GetLibItemName();
|
curr_partName = curr_libId.GetLibItemName();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
reload_currentPart = isCurrentPart( libId );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
reload_currentPart = isCurrentPart( libId );
|
|
||||||
|
|
||||||
int unit = m_unit;
|
int unit = m_unit;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue