Skip to content

Commit

Permalink
[chip-tool] Do not try to reset an element that does not exists in th…
Browse files Browse the repository at this point in the history
…e case of a group command (#17844)
  • Loading branch information
vivien-apple authored Apr 28, 2022
1 parent aa0f07a commit 0ff0b15
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/chip-tool/commands/clusters/ClusterCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ class ClusterCommand : public ModelCommand, public chip::app::CommandSender::Cal

virtual void OnDone(chip::app::CommandSender * client) override
{
mCommandSender.front().reset();
mCommandSender.erase(mCommandSender.begin());
if (mCommandSender.size())
{
mCommandSender.front().reset();
mCommandSender.erase(mCommandSender.begin());
}

// If the command is repeated N times, wait for all the responses to comes in
// before exiting.
Expand Down

0 comments on commit 0ff0b15

Please sign in to comment.