From 43a622cadf9de601b03bd96a2108e009ba22a315 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 28 May 2024 06:54:23 -0700 Subject: [PATCH] Ensure we are checking all ERC errors Also, handle the possiblity that we return NULL when calling DeserializeFromString in the case where we don't handle all cases or the file is corrupted --- eeschema/erc/erc_item.cpp | 1 + eeschema/schematic.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/eeschema/erc/erc_item.cpp b/eeschema/erc/erc_item.cpp index 9c7084e8b3..12cc56a6c3 100644 --- a/eeschema/erc/erc_item.cpp +++ b/eeschema/erc/erc_item.cpp @@ -221,6 +221,7 @@ std::vector> ERC_ITEM::allItemTypes( { ERC_ITEM::busEntryNeeded, ERC_ITEM::endpointOffGrid, ERC_ITEM::fourWayJunction, + ERC_ITEM::duplicatePinError, ERC_ITEM::heading_conflicts, ERC_ITEM::duplicateReference, diff --git a/eeschema/schematic.cpp b/eeschema/schematic.cpp index d33881ace7..1813fe7bb4 100644 --- a/eeschema/schematic.cpp +++ b/eeschema/schematic.cpp @@ -316,6 +316,12 @@ std::vector SCHEMATIC::ResolveERCExclusions() { SCH_MARKER* testMarker = SCH_MARKER::DeserializeFromString( this, *it ); + if( !testMarker ) + { + it = settings.m_ErcExclusions.erase( it ); + continue; + } + if( testMarker->IsLegacyMarker() ) { const wxString settingsKey = testMarker->GetRCItem()->GetSettingsKey();