mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
plugins: patch in empty string when no default given
If a plugin fails to pass in a default value for an option, c-lightning crashes. this fixes the crash. Patches #2515
This commit is contained in:
parent
02ddeed2a7
commit
f48fe03815
1 changed files with 2 additions and 0 deletions
|
@ -984,6 +984,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);
|
||||
}
|
||||
json_object_end(req->stream); /* end of .params.options */
|
||||
|
|
Loading…
Add table
Reference in a new issue