Skip to content

Commit

Permalink
[processing] fix enum parameter check
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Mar 8, 2025
1 parent 5ace827 commit 4d121de
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class EnumParameter : public Parameter

void setUintValue(uint value) override
{
checkEnumValue(value);
checkEnumValueEnabled(value);
Parameter::setUintValue(value);
}

Expand Down Expand Up @@ -109,6 +109,11 @@ class EnumParameter : public Parameter
"Invalid enum value: " + std::to_string(value) +
"; expected value in [0, " +
std::to_string(mEnumValues.size()) + ")");
}

void checkEnumValueEnabled(uint value) const
{
checkEnumValue(value);
if (mEnabled[value] == false)
throw std::runtime_error(
"Enum value " + std::to_string(value) + " is disabled.");
Expand Down

0 comments on commit 4d121de

Please sign in to comment.