Don't assume we have a MODULE parent

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6063
This commit is contained in:
Jon Evans 2020-10-19 20:54:58 -04:00
parent f8d38fc6c0
commit 0d5b5bf8c3
2 changed files with 7 additions and 1 deletions

View File

@ -1233,6 +1233,12 @@ const BOX2I D_PAD::ViewBBox() const
}
MODULE* D_PAD::GetParent() const
{
return dynamic_cast<MODULE*>( m_Parent );
}
void D_PAD::ImportSettingsFrom( const D_PAD& aMasterPad )
{
SetShape( aMasterPad.GetShape() );

View File

@ -108,7 +108,7 @@ public:
return false;
}
MODULE* GetParent() const { return (MODULE*) m_Parent; }
MODULE* GetParent() const;
/**
* Imports the pad settings from aMasterPad.