Merge pull request #6562 from sellout/broken-cli-help

Fix zcash-cli crash when printing help message
This commit is contained in:
Kris Nuttycombe 2023-04-15 22:09:26 -06:00 committed by GitHub
commit 0679ee64b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -212,12 +212,12 @@ UniValue ConvertValues(const std::string &strMethod, const std::vector<std::stri
auto helpMsg = CallRPC("help", ConvertValues("help", {strMethod})); auto helpMsg = CallRPC("help", ConvertValues("help", {strMethod}));
return "\n\n" return "\n\n"
+ (helpMsg.has_value() + (helpMsg.has_value()
? strprintf( ? "Usage: " + helpMsg.value().get_str()
: strprintf(
"An error occurred while attempting to retrieve the " "An error occurred while attempting to retrieve the "
"help text for %s: %s", "help text for %s: %s",
strMethod, strMethod,
helpMsg.error().get_str()) helpMsg.error().get_str()));
: helpMsg->get_str());
} }
})); }));
}) })