FIX: potential crash
This commit is contained in:
parent
a42d331e38
commit
4f345b20a8
@ -172,6 +172,10 @@ router.post('/payinvoice', async function(req, res) {
|
|||||||
return errorLnd(res);
|
return errorLnd(res);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (!info.num_satoshis && !info.num_satoshis) {
|
||||||
|
// tip invoice, but someone forgot to specify amount
|
||||||
|
return errorBadArguments(res);
|
||||||
|
}
|
||||||
let inv = { payment_request: req.body.invoice, amt: info.num_satoshis }; // amt is used only for 'tip' invoices
|
let inv = { payment_request: req.body.invoice, amt: info.num_satoshis }; // amt is used only for 'tip' invoices
|
||||||
try {
|
try {
|
||||||
logger.log('/payinvoice', [req.id, 'before write', JSON.stringify(inv)]);
|
logger.log('/payinvoice', [req.id, 'before write', JSON.stringify(inv)]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user