Skip to content

Commit

Permalink
Merge pull request #5 from bleskomat/fix/when-params-is-empty-array
Browse files Browse the repository at this point in the history
fix: when param is empty array send full config
  • Loading branch information
chill117 authored Jun 5, 2024
2 parents 6e2f7e8 + d545603 commit 75e3f4e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/json-rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,11 @@ namespace {
docOut["result"] = docInfo;
sendToInterfaces(docOut);
} else if (method == "getconfig") {
const std::string paramsText = data["params"][0].as<const char*>();
DynamicJsonDocument docOut(JSON_DOC_SIZE);
docOut["jsonrpc"] = jsonRpcVersion;
docOut["id"] = id;
DynamicJsonDocument requestedConfigs(JSON_DOC_SIZE);
if (data["params"].is<JsonArray>()) {
if (data.containsKey("params") && data["params"].is<JsonArray>() && data["params"].as<JsonArray>().size() > 0) {
const JsonArray params = data["params"].as<JsonArray>();
for (const auto param : params) {
const std::string key = param.as<const char*>();
Expand Down

0 comments on commit 75e3f4e

Please sign in to comment.