fix(telegram): guard null persisted update id normalization

This commit is contained in:
Peter Steinberger
2026-03-07 21:10:31 +00:00
parent c35f529fac
commit a3db68f9ab

View File

@@ -70,6 +70,9 @@ const POLL_WATCHDOG_INTERVAL_MS = 30_000;
type TelegramBot = ReturnType<typeof createTelegramBot>;
function normalizePersistedUpdateId(value: number | null): number | null {
if (value === null) {
return null;
}
if (!Number.isSafeInteger(value) || value < 0) {
return null;
}