mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 00:24:19 +01:00
plugins: don't hand empty strings for unset options.
This was deeply surprising to me; there's a difference between a value not being specified, and it being specified as "". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
f65eecee27
commit
8b2a84a0c7
@@ -1000,9 +1000,8 @@ static void plugin_config(struct plugin *plugin)
|
||||
list_for_each(&plugin->plugin_opts, opt, list) {
|
||||
/* Trim the `--` that we added before */
|
||||
name = opt->name + 2;
|
||||
if (!opt->value)
|
||||
opt->value = "";
|
||||
json_add_string(req->stream, name, opt->value);
|
||||
if (opt->value)
|
||||
json_add_string(req->stream, name, opt->value);
|
||||
}
|
||||
json_object_end(req->stream); /* end of .params.options */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user