From 5da180dd291d2bd0ea8b7b85eae86bf4da2b20e8 Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:26:30 +0200 Subject: [PATCH] fix smtp form edge case --- .../components/interfaces/Auth/SmtpForm/SmtpForm.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx b/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx index 601c2557e80..419ae5b7350 100644 --- a/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx +++ b/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx @@ -77,8 +77,14 @@ const smtpDisabledSchema = z.object({ SMTP_ADMIN_EMAIL: z.string().optional(), SMTP_SENDER_NAME: z.string().optional(), SMTP_HOST: z.string().optional(), - SMTP_PORT: z.number().optional(), - SMTP_MAX_FREQUENCY: z.number().optional(), + SMTP_PORT: z.preprocess( + (val) => (val === '' || val == null ? undefined : val), + z.coerce.number().optional() + ), + SMTP_MAX_FREQUENCY: z.preprocess( + (val) => (val === '' || val == null ? undefined : val), + z.coerce.number().optional() + ), SMTP_USER: z.string().optional(), SMTP_PASS: z.string().optional(), })