From 39a8ab87380343cda438d8da8f20dfe741c7d861 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 10 Dec 2022 16:04:27 -0500 Subject: [PATCH] Make sure to set the lib table for a plugin before it gets used Fixes https://gitlab.com/kicad/code/kicad/-/issues/12847 --- eeschema/symbol_lib_table.cpp | 3 ++- eeschema/symbol_tree_model_adapter.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/eeschema/symbol_lib_table.cpp b/eeschema/symbol_lib_table.cpp index 4becb4ca03..1938401145 100644 --- a/eeschema/symbol_lib_table.cpp +++ b/eeschema/symbol_lib_table.cpp @@ -355,9 +355,10 @@ void SYMBOL_LIB_TABLE::LoadSymbolLib( std::vector& aSymbolList, wxString options = row->GetOptions(); if( aPowerSymbolsOnly ) - row->SetOptions( row->GetOptions() + " " + PropPowerSymsOnly ); + row->SetOptions( row->GetOptions() + " " + PropPowerSymsOnly ); row->SetLoaded( false ); + row->plugin->SetLibTable( this ); row->plugin->EnumerateSymbolLib( aSymbolList, row->GetFullURI( true ), row->GetProperties() ); row->SetLoaded( true ); diff --git a/eeschema/symbol_tree_model_adapter.cpp b/eeschema/symbol_tree_model_adapter.cpp index 998a98f08c..5afdedffb7 100644 --- a/eeschema/symbol_tree_model_adapter.cpp +++ b/eeschema/symbol_tree_model_adapter.cpp @@ -133,6 +133,8 @@ bool SYMBOL_TREE_MODEL_ADAPTER::AddLibraries( const std::vector& aNick { SYMBOL_LIB_TABLE_ROW* row = m_libs->FindRow( pair.first ); + wxCHECK2( row, continue ); + if( !row->GetIsVisible() ) continue;