From 74cff317f8b246d8a7c2472fcb7f98e79bd4869a Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 22 Mar 2022 00:08:57 +0200 Subject: [PATCH] Fix not being able to send empty friend code --- app/routes/play/settings.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/routes/play/settings.tsx b/app/routes/play/settings.tsx index ca4b0e54d..ca9d5a5b0 100644 --- a/app/routes/play/settings.tsx +++ b/app/routes/play/settings.tsx @@ -51,7 +51,10 @@ const settingsActionSchema = z.object({ safeJSONParse, z.array(z.enum(weapons)).max(LFG_WEAPON_POOL_MAX_LENGTH) ), - friendCode: z.preprocess(falsyToNull, z.string().regex(friendCodeRegExp)), + friendCode: z.preprocess( + falsyToNull, + z.string().regex(friendCodeRegExp).nullable() + ), }); export const action: ActionFunction = async ({ request, context }) => {