Skip to content

Commit

Permalink
Don't parse JSON command if the previous one is currently in processing
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Jul 29, 2022
1 parent 5533f4d commit 3f3a9d2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ void AllClustersCommandDelegate::OnEventCommandReceived(const char * json)
{
Json::Reader reader;

if (!mJsonValue.empty())
{
ChipLogError(NotSpecified, "Not ready to process JSON command");
return;
}

if (!reader.parse(json, mJsonValue))
{
ChipLogError(NotSpecified, "Error parsing JSON with error %s:", reader.getFormattedErrorMessages().c_str());
Expand Down

0 comments on commit 3f3a9d2

Please sign in to comment.