From 6c2433fed60cc16248307c57449cf7646684fa62 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Sun, 4 Oct 2020 22:28:08 +0100 Subject: [PATCH] eeschema: Fix nullptr reference in intersheet references Fixes https://gitlab.com/kicad/code/kicad/issues/5881 --- eeschema/sch_iref.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_iref.cpp b/eeschema/sch_iref.cpp index e3c70eda9d..a63388ea36 100644 --- a/eeschema/sch_iref.cpp +++ b/eeschema/sch_iref.cpp @@ -73,7 +73,7 @@ EDA_ITEM* SCH_IREF::Clone() const 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 ) ); switch( aSpinStyle ) @@ -108,7 +108,7 @@ void SCH_IREF::SetIrefOrientation( LABEL_SPIN_STYLE aSpinStyle ) break; } - SetPosition( GetParent()->GetPosition() + pt ); + SetPosition( m_parentLabel->GetPosition() + pt ); } @@ -138,4 +138,4 @@ void SCH_IREF::BuildHypertextMenu( wxMenu* aMenu ) aMenu->AppendSeparator(); aMenu->Append( ID_HYPERTEXT_BACK, _( "Back" ) ); -} \ No newline at end of file +}