diff options
| author | Adam Soltys <[email protected]> | 2023-02-28 18:06:52 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-28 18:07:05 +0000 |
| commit | 80fe35caae77ab6551c35f340a18007e2bfb9750 (patch) | |
| tree | b7868bd413900556fd966a505b6eeb97cf60461f /routes/nostr.js | |
| parent | ea794b2a1c7679bcd0e053ef623c234ad3700fb0 (diff) | |
| download | coinos-server-80fe35caae77ab6551c35f340a18007e2bfb9750.tar.gz coinos-server-80fe35caae77ab6551c35f340a18007e2bfb9750.zip | |
bail if event not found
Diffstat (limited to 'routes/nostr.js')
| -rw-r--r-- | routes/nostr.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/routes/nostr.js b/routes/nostr.js index eff956d1..7670bd5f 100644 --- a/routes/nostr.js +++ b/routes/nostr.js @@ -6,6 +6,8 @@ import { pool, q } from "$lib/nostr"; export default { async event({ params: { id } }, res) { let event = await g(`ev:${id}`); + if (!event) return bail("event not found"); + let { pubkey } = event; event.user = (await g(`user:${pubkey}`)) || { |
