Sim: Fix crash when a field tries to set an inexistent parameter

Refactored SetParamValue() and friends to use exceptions instead of
return values.
This commit is contained in:
Mikolaj Wielgus
2022-10-12 04:27:48 +02:00
parent 6ae333a116
commit c857e533a9
10 changed files with 62 additions and 52 deletions
+1 -1
View File
@@ -225,7 +225,7 @@ void SIM_MODEL_SOURCE::WriteDataLibFields( std::vector<LIB_FIELD>& aFields ) con
}
bool SIM_MODEL_SOURCE::SetParamValue( int aParamIndex, const SIM_VALUE& aValue )
void SIM_MODEL_SOURCE::SetParamValue( int aParamIndex, const SIM_VALUE& aValue )
{
// Sources are special. All preceding parameter values must be filled. If they are not, fill
// them out automatically. If a value is nulled, delete everything after it.