From 03e9f0c94a5423707d46da90e2bdbd385ab96d57 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sun, 31 Dec 2017 10:07:58 -0500 Subject: [PATCH] Eeschema: fix broken library symbol link for missing libraries. When an attempt to resolve a library symbol link having a library nickname that was no longer found in the symbol library table, the symbol resolution was not falling back to the cache library due to a silently handled exception. Add check for valid symbol library table nickname before attempting to resolve symbol link to prevent exception bypassing falling back to the cache library. Fixes lp:1740609 https://bugs.launchpad.net/kicad/+bug/1740609 --- eeschema/sch_component.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index d5a316b1b9..c8dd4153ed 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -321,7 +321,10 @@ bool SCH_COMPONENT::Resolve( SYMBOL_LIB_TABLE& aLibTable, PART_LIB* aCacheLib ) try { - if( m_lib_id.IsValid() ) + // LIB_TABLE_BASE::LoadSymbol() throws an IO_ERROR if the the library nickname + // is not found in the table so check if the library still exists in the table + // before attempting to load the symbol. + if( m_lib_id.IsValid() && aLibTable.HasLibrary( m_lib_id.GetLibNickname() ) ) alias = aLibTable.LoadSymbol( m_lib_id ); // Fall back to cache library. This is temporary until the new schematic file