From 3ce1b2b44ead4b5e5af4936b28b50f3f97802244 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 3 Sep 2020 12:47:51 +0100 Subject: [PATCH] Clean up Coverity warning. --- eeschema/dialogs/dialog_edit_component_in_schematic.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp index 757d037d0c..0e9bc6912a 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp @@ -274,6 +274,11 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( SCH_EDIT { m_comp = aComponent; m_part = m_comp->GetPartRef().get(); + + // GetPartRef() now points to the cached part in the schematic, which should always be + // there + wxASSERT( m_part ); + m_fields = new FIELDS_GRID_TABLE( this, aParent, m_part ); m_width = 0; @@ -431,13 +436,15 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow() m_unitChoice->Enable( false ); } - if( m_part != nullptr && m_part->HasConversion() ) + if( m_part->HasConversion() ) { if( m_comp->GetConvert() > LIB_ITEM::LIB_CONVERT::BASE ) m_cbAlternateSymbol->SetValue( true ); } else + { m_cbAlternateSymbol->Enable( false ); + } // Set the symbol orientation and mirroring. int orientation = m_comp->GetOrientation() & ~( CMP_MIRROR_X | CMP_MIRROR_Y );