sim_model: Fix a not handled exception that fully freeze Eeschema.

Can happens with schematics with old sim parameter syntax.
This commit is contained in:
jean-pierre charras 2022-12-13 11:15:02 +01:00
parent 93e313440e
commit bbdb30135e
1 changed files with 13 additions and 6 deletions

View File

@ -952,15 +952,22 @@ void SIM_MODEL::CreatePins( unsigned aSymbolPinCount )
template <typename T>
void SIM_MODEL::doReadDataFields( unsigned aSymbolPinCount, const std::vector<T>* aFields )
{
m_serde->ParseEnable( GetFieldValue( aFields, ENABLE_FIELD ) );
try
{
m_serde->ParseEnable( GetFieldValue( aFields, ENABLE_FIELD ) );
CreatePins( aSymbolPinCount );
m_serde->ParsePins( GetFieldValue( aFields, PINS_FIELD ) );
CreatePins( aSymbolPinCount );
m_serde->ParsePins( GetFieldValue( aFields, PINS_FIELD ) );
std::string paramsField = GetFieldValue( aFields, PARAMS_FIELD );
std::string paramsField = GetFieldValue( aFields, PARAMS_FIELD );
if( !m_serde->ParseParams( paramsField ) )
m_serde->ParseValue( GetFieldValue( aFields, VALUE_FIELD ) );
if( !m_serde->ParseParams( paramsField ) )
m_serde->ParseValue( GetFieldValue( aFields, VALUE_FIELD ) );
}
catch( IO_ERROR& err )
{
DisplayErrorMessage( nullptr, err.What() );
}
}