Skip to content

Commit

Permalink
xpay-handle-pay: bugfix, handle null parameters
Browse files Browse the repository at this point in the history
Changelog-Fixed: xpay-handle-pay: handle null parameters passed in the "param" list.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
  • Loading branch information
Lagrang3 committed Dec 19, 2024
1 parent fa10323 commit c1a5c6e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/xpay/xpay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1914,6 +1914,12 @@ static struct command_result *handle_rpc_command(struct command *cmd,
bolt11 = params_tok + 1;
if (params_tok->size == 2)
amount_msat = json_next(bolt11);

/* some arguments could have null values in the list */
if (bolt11 && json_tok_is_null(buf, bolt11))
bolt11 = NULL;
if (amount_msat && json_tok_is_null(buf, amount_msat))
amount_msat = NULL;
} else if (params_tok->type == JSMN_OBJECT) {
const jsmntok_t *t, *maxfeepercent = NULL, *exemptfee = NULL;
size_t i;
Expand Down

0 comments on commit c1a5c6e

Please sign in to comment.