Skip to content

Commit

Permalink
Incorrect handling of operational errors (#28942)
Browse files Browse the repository at this point in the history
* Made the InEqual method const to enusre that the values are not modified.

* Fixed the error checking in the OnOperationalErrorDetected method.
  • Loading branch information
hicklin authored and pull[bot] committed Nov 3, 2023
1 parent 5920ea6 commit 2451672
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct GenericOperationalError : public app::Clusters::detail::Structs::ErrorSta
}
}

bool IsEqual(const Structs::ErrorStateStruct::Type & rhs)
bool IsEqual(const Structs::ErrorStateStruct::Type & rhs) const
{
if (errorStateID != rhs.errorStateID)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void Instance::OnOperationalErrorDetected(const Structs::ErrorStateStruct::Type
}

// Set the OperationalError attribute
if (mOperationalError.IsEqual(aError))
if (!mOperationalError.IsEqual(aError))
{
mOperationalError.Set(aError.errorStateID, aError.errorStateLabel, aError.errorStateDetails);
ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::OperationalError::Id);
Expand Down

0 comments on commit 2451672

Please sign in to comment.