diff --git a/src/routes/webhook.js b/src/routes/webhook.js index 699cc6c..7a6f9c4 100644 --- a/src/routes/webhook.js +++ b/src/routes/webhook.js @@ -51,6 +51,7 @@ export const webhookRoutes = (fastify, _, done) => { const feed = body["feed"]; // Example processing: log the video IDs of new videos const entry = feed.entry[0]; + if(!entry) return reply.code(200).send(); const [{users: user, sites: site}] = await db.select().from(users).leftJoin(sites, eq(users.id, sites.user_id)).where(eq(users.channel_id, "UC" + feed["yt:channelId"][0])); if (!user || !site) throw new Error("User not found");