fix metacluster get segfault (#9693)

This commit is contained in:
Jon Fu 2023-03-23 11:21:25 -07:00 committed by GitHub
parent 18a0fa0263
commit 6c337e5c7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -418,7 +418,7 @@ ACTOR Future<bool> metaclusterListCommand(Reference<IDatabase> db, std::vector<S
// metacluster get command
ACTOR Future<bool> metaclusterGetCommand(Reference<IDatabase> db, std::vector<StringRef> tokens) {
if (tokens.size() > 4 || (tokens.size() == 4 && tokens[3] != "JSON"_sr)) {
if (tokens.size() > 4 || tokens.size() < 3 || (tokens.size() == 4 && tokens[3] != "JSON"_sr)) {
fmt::print("Usage: metacluster get <NAME> [JSON]\n\n");
fmt::print("Prints metadata associated with the given data cluster.\n");
fmt::print("If JSON is specified, then the output will be in JSON format.\n");