Sim: Fix crash due to accessing param 0 of TYPE::NONE model
This commit is contained in:
parent
20eca94fca
commit
cfdf6c097d
|
@ -1589,6 +1589,8 @@ void SIM_MODEL::InferredReadDataFields( unsigned aSymbolPinCount, const std::vec
|
||||||
ParseParamsField( GetFieldValue( aFields, VALUE_FIELD ) );
|
ParseParamsField( GetFieldValue( aFields, VALUE_FIELD ) );
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& e )
|
catch( const IO_ERROR& e )
|
||||||
|
{
|
||||||
|
if( GetParamCount() >= 1 )
|
||||||
{
|
{
|
||||||
if( aAllowOnlyFirstValue )
|
if( aAllowOnlyFirstValue )
|
||||||
SetParamValue( 0, parseFieldFloatValue( valueField ) );
|
SetParamValue( 0, parseFieldFloatValue( valueField ) );
|
||||||
|
@ -1596,7 +1598,8 @@ void SIM_MODEL::InferredReadDataFields( unsigned aSymbolPinCount, const std::vec
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( aAllowOnlyFirstValue )
|
}
|
||||||
|
else if( GetParamCount() >= 1 && aAllowOnlyFirstValue )
|
||||||
{
|
{
|
||||||
// This is reached only when model allows only the first value.
|
// This is reached only when model allows only the first value.
|
||||||
SetParamValue( 0, parseFieldFloatValue( valueField ) );
|
SetParamValue( 0, parseFieldFloatValue( valueField ) );
|
||||||
|
|
Loading…
Reference in New Issue