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 )
|
catch( const IO_ERROR& e )
|
||||||
{
|
{
|
||||||
if( aAllowOnlyFirstValue )
|
if( GetParamCount() >= 1 )
|
||||||
SetParamValue( 0, parseFieldFloatValue( valueField ) );
|
{
|
||||||
else
|
if( aAllowOnlyFirstValue )
|
||||||
throw e;
|
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.
|
// This is reached only when model allows only the first value.
|
||||||
SetParamValue( 0, parseFieldFloatValue( valueField ) );
|
SetParamValue( 0, parseFieldFloatValue( valueField ) );
|
||||||
|
|
Loading…
Reference in New Issue