From d65cf1b4575e91acfc8057b5b32653e6edbc88dd Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 8 Jan 2023 17:59:27 +0000 Subject: [PATCH] Check parameters before assuming we can handle the model. Fixes https://gitlab.com/kicad/code/kicad/issues/13444 --- eeschema/sch_screen.h | 5 ----- eeschema/sim/sim_model.cpp | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/eeschema/sch_screen.h b/eeschema/sch_screen.h index d010544fec..36dba2cf19 100644 --- a/eeschema/sch_screen.h +++ b/eeschema/sch_screen.h @@ -530,11 +530,6 @@ private: void clearLibSymbols(); - /** - * Migrate the symbol's V6 simulation model SCH_FIELDs to their V7 equivalents - */ - void migrateSimModel( SCH_SYMBOL& aSymbol ); - public: /** * last value for the zoom level, useful in Eeschema when changing the current displayed diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index d80e4498ee..342b0f77da 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -1650,6 +1650,9 @@ void SIM_MODEL::MigrateSimModel( T_symbol& aSymbol, const PROJECT* aProject ) { model->SetParamValue( ii, tokenizer.GetNextToken().ToStdString(), SIM_VALUE_GRAMMAR::NOTATION::SPICE ); + + if( !model->GetParam( ii ).value->HasValue() ) + THROW_IO_ERROR( "fall back to raw SPICE" ); } spiceTypeInfo.m_Text = SIM_MODEL::TypeInfo( type ).fieldValue;