From 6ae333a116a613d179e3d285565e4a615255b58e Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Wed, 12 Oct 2022 03:38:12 +0200 Subject: [PATCH] Sim Model Editor: Fix crash when opening sources --- eeschema/sim/sim_model_source.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eeschema/sim/sim_model_source.cpp b/eeschema/sim/sim_model_source.cpp index b7bbd78fbf..ef7f04448e 100644 --- a/eeschema/sim/sim_model_source.cpp +++ b/eeschema/sim/sim_model_source.cpp @@ -235,7 +235,7 @@ bool SIM_MODEL_SOURCE::SetParamValue( int aParamIndex, const SIM_VALUE& aValue ) paramIndex < GetParamCount(); ++paramIndex ) { - SIM_MODEL::SetParamValue( paramIndex, "" ); + m_params.at( aParamIndex ).value->FromString( "" ); } } else @@ -243,7 +243,10 @@ bool SIM_MODEL_SOURCE::SetParamValue( int aParamIndex, const SIM_VALUE& aValue ) for( int paramIndex = 0; paramIndex < aParamIndex; ++paramIndex ) { if( GetParam( paramIndex ).value->ToString() == "" ) + { + m_params.at( aParamIndex ).value->FromString( "0" ); SIM_MODEL::SetParamValue( paramIndex, "0" ); + } } }