Skip to content

Commit d03d756

Browse files
author
Razvan Aguridan
committed
Fix instant ocean fields encoding
1 parent 940cbff commit d03d756

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/multio/action/encode/GribEncoder.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,9 @@ void GribEncoder::setOceanMetadata(message::Metadata& md) {
819819
setValue(glossary().paramId, paramInt + 4000);
820820
}
821821
else {
822-
setValue(glossary().paramId, paramInt + ops_to_code.at(md.get<std::string>(glossary().operation)));
822+
const auto operation = md.getOpt<std::string>(glossary().operation);
823+
const auto paramIdIncrement = operation ? ops_to_code.at(*operation) : 0;
824+
setValue(glossary().paramId, paramInt + paramIdIncrement);
823825
}
824826

825827
const auto& typeOfLevel = md.get<std::string>(glossary().typeOfLevel);

0 commit comments

Comments
 (0)