Skip to content

Commit a134527

Browse files
pcaspersjenkins
authored andcommitted
QPR-12349 handle invalid inputs (in particular NA)
1 parent b990bfd commit a134527

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

OREAnalytics/orea/scenario/historicalscenariofilereader.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ boost::shared_ptr<ore::analytics::Scenario> HistoricalScenarioFileReader::scenar
7575
Real numeraire = parseReal(file_.get("Numeraire"));
7676
TLOG("Creating scenario for date " << io::iso_date(date));
7777
boost::shared_ptr<Scenario> scenario = scenarioFactory_->buildScenario(date, "", numeraire);
78+
Real value;
7879
for (Size k = 0; k < keys_.size(); ++k) {
79-
scenario->add(keys_[k], parseReal(file_.get(k + 3)));
80+
if (tryParseReal(file_.get(k + 3), value))
81+
scenario->add(keys_[k], value);
8082
}
8183
return scenario;
8284
}

0 commit comments

Comments
 (0)