Skip to content

Commit

Permalink
Correctly clean up VectorBool optional arguments in chip-tool. (proje…
Browse files Browse the repository at this point in the history
…ct-chip#22414)

We were not actually resetting the Optional (and in fact were operating on
totally the wrong type, and it's not clear why this was not crashing all the
time).

Fixes project-chip#22406
  • Loading branch information
bzbarsky-apple authored and isiu-apple committed Sep 16, 2022
1 parent 8fa2dcd commit 5d02646
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions examples/chip-tool/commands/common/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,7 @@ void Command::ResetArguments()
break;
}
case ArgumentType::VectorBool: {
auto vectorArgument = static_cast<std::vector<bool> *>(arg.value);
vectorArgument->clear();
ResetOptionalArg<std::vector<bool>>(arg);
break;
}
case ArgumentType::Vector16: {
Expand Down

0 comments on commit 5d02646

Please sign in to comment.