From a2cbd1ff217823ceaa4e43e213e9e1317cb2e3df Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 14 Jun 2024 19:14:00 +0200 Subject: [PATCH] Fix QA tests compatibility --- eeschema/sch_item.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eeschema/sch_item.cpp b/eeschema/sch_item.cpp index b2131e3cc9..fc214f384e 100644 --- a/eeschema/sch_item.cpp +++ b/eeschema/sch_item.cpp @@ -116,6 +116,11 @@ SCH_ITEM::~SCH_ITEM() for( const auto& it : m_connection_map ) delete it.second; + // Do not try to modify SCHEMATIC::ConnectionGraph() + // if the schematic does not exist + if( !SCHEMATIC::m_IsSchematicExists ) + return; + SCHEMATIC* sch = Schematic(); if( sch != nullptr ) @@ -144,11 +149,6 @@ SCH_ITEM* SCH_ITEM::Duplicate( bool doClone ) const SCHEMATIC* SCH_ITEM::Schematic() const { - if( !SCHEMATIC::m_IsSchematicExists ) - { - return nullptr; - } - EDA_ITEM* parent = GetParent(); while( parent )