Eeschema: fix crash when trying to edit a non symbol field using U,V or F

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21072
This commit is contained in:
jean-pierre charras
2025-06-05 16:39:50 +02:00
parent c278deb9ef
commit a04bead8b0
+6
View File
@@ -1905,7 +1905,13 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent )
|| ( aEvent.IsAction( &SCH_ACTIONS::editFootprint ) && field->GetId() != FIELD_T::FOOTPRINT ) )
{
item = field->GetParentSymbol();
m_selectionTool->ClearSelection( true );
// If the field to edit is not a symbol field, we cannot edit the ref, value or footprint
if( item == nullptr )
return 0;
m_selectionTool->AddItemToSel( item );
}
}