Fix crash with invalid nip98 base64

This commit is contained in:
Alex Gleason 2023-07-08 21:01:49 -05:00
parent 4e68e3868f
commit fb9bb284db
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}
});