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