From cae4c2172f127c0cbf5146c85cecfe28c1403834 Mon Sep 17 00:00:00 2001 From: Eliezer Steinbock <3090527+elie222@users.noreply.github.com> Date: Mon, 30 Dec 2024 10:40:48 +0200 Subject: [PATCH] Fix build --- apps/web/utils/actions/mail.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/utils/actions/mail.ts b/apps/web/utils/actions/mail.ts index f38198ef5..b240459a8 100644 --- a/apps/web/utils/actions/mail.ts +++ b/apps/web/utils/actions/mail.ts @@ -22,7 +22,7 @@ import { withActionInstrumentation } from "@/utils/actions/middleware"; import { isActionError } from "@/utils/error"; // do not return functions to the client or we'll get an error -const isStatusOk = (status: number) => status >= 200 && status < 300; +const isStatusOk = (status?: number) => status && status >= 200 && status < 300; export const archiveThreadAction = withActionInstrumentation( "archiveThread", @@ -39,7 +39,7 @@ export const archiveThreadAction = withActionInstrumentation( labelId, }); - if (!isStatusOk(res.status)) return { error: "Failed to archive thread" }; + if (!isStatusOk(res?.status)) return { error: "Failed to archive thread" }; }, );