diff --git a/pcbnew/tools/footprint_editor_tools.cpp b/pcbnew/tools/footprint_editor_tools.cpp index fb53e78be9..99bb770d24 100644 --- a/pcbnew/tools/footprint_editor_tools.cpp +++ b/pcbnew/tools/footprint_editor_tools.cpp @@ -111,11 +111,14 @@ int MODULE_EDITOR_TOOLS::PlacePad( const TOOL_EVENT& aEvent ) void PlaceItem( BOARD_ITEM *aItem, BOARD_COMMIT& aCommit ) override { - auto pad = dynamic_cast( aItem ); - m_frame->Export_Pad_Settings( pad ); + D_PAD* pad = dynamic_cast( aItem ); - static_cast( aItem )->SetLocalCoord(); - aCommit.Add( aItem ); + if( pad ) + { + m_frame->Export_Pad_Settings( pad ); + pad->SetLocalCoord(); + aCommit.Add( aItem ); + } } };