Fix crash in SCH_LABEL_BASE::IsType() when the item is not living in a schematic.
It happens for instance when copying the item from the clipboard. From master branch. Fixes #11128
This commit is contained in:
parent
af4a4cbc08
commit
6f6505f6a1
|
@ -861,6 +861,11 @@ bool SCH_LABEL::IsType( const KICAD_T aScanTypes[] ) const
|
|||
|
||||
wxCHECK_MSG( Schematic(), false, wxT( "No parent SCHEMATIC set for SCH_LABEL!" ) );
|
||||
|
||||
// Ensure m_connected_items for Schematic()->CurrentSheet() exists.
|
||||
// Can be not the case when "this" is living in clipboard
|
||||
if( m_connected_items.find( Schematic()->CurrentSheet() ) == m_connected_items.end() )
|
||||
return false;
|
||||
|
||||
const SCH_ITEM_SET& item_set = m_connected_items.at( Schematic()->CurrentSheet() );
|
||||
|
||||
for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
|
||||
|
|
Loading…
Reference in New Issue