aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routes/lnurl.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/routes/lnurl.ts b/routes/lnurl.ts
index 8dcda8b2..1528d64c 100644
--- a/routes/lnurl.ts
+++ b/routes/lnurl.ts
@@ -53,10 +53,13 @@ export default {
query: { minSendable = 1000, maxSendable = 100000000000 },
} = req;
try {
- const { id: uid } = await getUser(
+ const user = await getUser(
username.replace("lightning:", "").replace(/\s/, "").toLowerCase(),
);
+ if (!user) fail(`User ${username} not found`);
+ const { id: uid } = user;
+
const metadata = JSON.stringify([
["text/plain", `Paying ${username}@${host}`],
["text/identifier", `${username}@${host}`],