Skip to content

Commit

Permalink
Follow-up to #1470 (#1482)
Browse files Browse the repository at this point in the history
Changes there left the PatchRecordComponent dirty after parsing
  • Loading branch information
franzpoeschel committed Jul 25, 2023
1 parent c5d60d2 commit 5e89ef9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/backend/PatchRecordComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,14 @@ void PatchRecordComponent::read()

if (containsAttribute("unitSI"))
{
/*
* No need to call setUnitSI
* If it's in the attributes map, then it's already set
* Just verify that it has the right type (getOptional<>() does
* conversions if possible, so this check is non-intrusive)
*/
if (auto val = getAttribute("unitSI").getOptional<double>();
val.has_value())
{
setUnitSI(val.value());
}
else
!val.has_value())
{
throw error::ReadError(
error::AffectedObject::Attribute,
Expand Down

0 comments on commit 5e89ef9

Please sign in to comment.