runes: fix checkrune when method parameter is the empty string.

This fix #6725.

Changelog-Fixed: fix `checkrune` when `method` parameter is the empty string.
This commit is contained in:
Tony Aldon 2023-10-10 18:30:10 +02:00 committed by Vincenzo Palazzo
parent ebee48ca8c
commit ae94be4ce2

View file

@ -827,7 +827,10 @@ static struct command_result *json_checkrune(struct command *cmd,
cinfo.runes = cmd->ld->runes;
cinfo.peer = nodeid;
cinfo.buf = buffer;
cinfo.method = method;
if (method != NULL && streq(method, ""))
cinfo.method = NULL;
else
cinfo.method = method;
cinfo.params = methodparams;
cinfo.now = time_now();
strmap_init(&cinfo.cached_params);