diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index bf50ce6219..57975a84a5 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -326,7 +326,9 @@ void WinEDA_PcbFrame::SendMessageToEESCHEMA( EDA_BaseStruct* objectToSync ) if( objectToSync->m_StructType == TYPEMODULE ) module = (MODULE*) objectToSync; else if( objectToSync->m_StructType == TYPEPAD ) - module = (MODULE*)((D_PAD*)objectToSync)->m_Parent; + module = (MODULE*) objectToSync->m_Parent; + else if( objectToSync->m_StructType == TYPETEXTEMODULE ) + module = (MODULE*) objectToSync->m_Parent; // ask only for the reference for now, maybe pins later. if( module )