mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 15:44:21 +01:00
plugin_control: don't assume plugin exists on error
Actually it often does not since there was an error..
This commit is contained in:
@@ -34,9 +34,13 @@ static struct command_result *plugin_dynamic_list_plugins(struct command *cmd)
|
||||
static struct command_result *
|
||||
plugin_dynamic_error(struct dynamic_plugin *dp, const char *error)
|
||||
{
|
||||
plugin_kill(dp->plugin, "%s: %s", dp->plugin->cmd, error);
|
||||
if (dp->plugin)
|
||||
plugin_kill(dp->plugin, "%s", error);
|
||||
else
|
||||
log_info(dp->cmd->ld->log, "%s", error);
|
||||
return command_fail(dp->cmd, JSONRPC2_INVALID_PARAMS,
|
||||
"%s: %s", dp->plugin->cmd, error);
|
||||
"%s: %s", dp->plugin ? dp->plugin->cmd : "unknown plugin",
|
||||
error);
|
||||
}
|
||||
|
||||
static void plugin_dynamic_timeout(struct dynamic_plugin *dp)
|
||||
|
||||
Reference in New Issue
Block a user