From fb9bb284db941da2ae1e31796095b2e4b28d39fc Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 8 Jul 2023 21:01:49 -0500 Subject: [PATCH] Fix crash with invalid nip98 base64 --- src/schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema.ts b/src/schema.ts index 9af967e..8027023 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -90,7 +90,7 @@ const decode64Schema = z.string().transform((value, ctx) => { const bytes = Uint8Array.from(binString, (m) => m.codePointAt(0)!); return new TextDecoder().decode(bytes); } catch (_e) { - ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Invalid base64' }); + ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Invalid base64', fatal: true }); return z.NEVER; } });