diff options
| -rw-r--r-- | routes/payments.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/routes/payments.js b/routes/payments.js index 02620ed4..0ee2bce0 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -40,9 +40,11 @@ export default { if (msatoshi) amount = Math.round(msatoshi / 1000); let invoice = await g(`invoice:${payment_hash}`); - if (invoice.uid === user.id) fail("Cannot send to self"); + if (invoice) { + if (invoice.uid === user.id) fail("Cannot send to self"); + hash = payment_hash; + } - if (invoice) hash = payment_hash; else { p = await debit( hash, |
