FIX: potential crash

This commit is contained in:
Overtorment 2019-01-06 12:19:08 +00:00
parent b3c0873e4c
commit 130a8dc773

View File

@ -171,7 +171,12 @@ router.post('/payinvoice', async function(req, 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
call.write(inv); try {
call.write(inv);
} catch (Err) {
logger.log('/payinvoice', [req.id, 'exception', JSON.stringify(Err)]);
return errorLnd(res);
}
} else { } else {
return errorNotEnougBalance(res); return errorNotEnougBalance(res);
} }