aboutsummaryrefslogtreecommitdiffstats
path: root/routes/payments.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-01-12 20:16:35 +0000
committerAdam Soltys <[email protected]>2024-01-12 20:16:37 +0000
commit6f36b0a9c1b47ed624f59ca769d41ca868aef054 (patch)
tree0501961a203cc33f1b6c669f5a9cb592841f31e1 /routes/payments.js
parent2444b62a4d254121bab0314972e260d839a18993 (diff)
downloadcoinos-server-6f36b0a9c1b47ed624f59ca769d41ca868aef054.tar.gz
coinos-server-6f36b0a9c1b47ed624f59ca769d41ca868aef054.zip
handle missing payments
Diffstat (limited to 'routes/payments.js')
-rw-r--r--routes/payments.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/routes/payments.js b/routes/payments.js
index dc6eb292..b9273120 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -89,6 +89,10 @@ export default {
await Promise.all(
payments.map(async (id) => {
let p = await g(`payment:${id}`);
+ if (!p) {
+ warn("missing payment", id);
+ return p;
+ }
if (p.created < start || p.created > end) return;
if (p.type === types.internal) p.with = await g(`user:${p.ref}`);
return p;