eeschema: Fix nullptr reference in intersheet references

Fixes https://gitlab.com/kicad/code/kicad/issues/5881
This commit is contained in:
Ian McInerney 2020-10-04 22:28:08 +01:00
parent bdb18022c0
commit 6c2433fed6
1 changed files with 3 additions and 3 deletions

View File

@ -73,7 +73,7 @@ EDA_ITEM* SCH_IREF::Clone() const
void SCH_IREF::SetIrefOrientation( LABEL_SPIN_STYLE aSpinStyle ) void SCH_IREF::SetIrefOrientation( LABEL_SPIN_STYLE aSpinStyle )
{ {
wxPoint pt = GetTextPos() - GetParent()->GetPosition(); wxPoint pt = GetTextPos() - m_parentLabel->GetPosition();
int offset = std::max( abs( pt.x ), abs( pt.y ) ); int offset = std::max( abs( pt.x ), abs( pt.y ) );
switch( aSpinStyle ) switch( aSpinStyle )
@ -108,7 +108,7 @@ void SCH_IREF::SetIrefOrientation( LABEL_SPIN_STYLE aSpinStyle )
break; break;
} }
SetPosition( GetParent()->GetPosition() + pt ); SetPosition( m_parentLabel->GetPosition() + pt );
} }
@ -138,4 +138,4 @@ void SCH_IREF::BuildHypertextMenu( wxMenu* aMenu )
aMenu->AppendSeparator(); aMenu->AppendSeparator();
aMenu->Append( ID_HYPERTEXT_BACK, _( "Back" ) ); aMenu->Append( ID_HYPERTEXT_BACK, _( "Back" ) );
} }