diff --git a/src/helpers/notifme.ts b/src/helpers/notifme.ts index 27ed48c2..ceb02891 100644 --- a/src/helpers/notifme.ts +++ b/src/helpers/notifme.ts @@ -331,7 +331,7 @@ export const sendNotification = async (message: string) => { if (getSecret("NOTIFICATION_TELEGRAM") && getSecret("NOTIFICATION_TELEGRAM_BOT_KEY")) { console.log("Sending Telegram"); try { - const chatIds = getSecret("NOTIFICATION_TELEGRAM_CHAT_ID").split(","); + const chatIds = getSecret("NOTIFICATION_TELEGRAM_CHAT_ID")?.split(",") ?? []; for (const chatId of chatIds) { await axios.post( `https://api.telegram.org/bot${getSecret("NOTIFICATION_TELEGRAM_BOT_KEY")}/sendMessage`,