Protect equality operator against invalid fields

This commit is contained in:
Seth Hillbrand 2023-10-21 00:55:54 +02:00
parent 0142b197f7
commit 27bf47d752
1 changed files with 3 additions and 0 deletions

View File

@ -602,6 +602,9 @@ bool LIB_FIELD::operator==( const LIB_ITEM& aItem ) const
if( m_name != field.m_name ) if( m_name != field.m_name )
return false; return false;
if( !m_parent || !aItem.GetParent() )
return false;
if( m_parent->m_Uuid != aItem.GetParent()->m_Uuid ) if( m_parent->m_Uuid != aItem.GetParent()->m_Uuid )
return false; return false;