From 6bf2c9983a0f6d4a00f24c531ca201850f7a6537 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Thu, 11 Jun 2026 15:16:13 -0700 Subject: [PATCH] Update js/desktop/src/lib/avatar-image.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- js/desktop/src/lib/avatar-image.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/desktop/src/lib/avatar-image.ts b/js/desktop/src/lib/avatar-image.ts index 2fc7aac..6bc9b79 100644 --- a/js/desktop/src/lib/avatar-image.ts +++ b/js/desktop/src/lib/avatar-image.ts @@ -10,6 +10,9 @@ export async function toAvatarBlob( source: ImageBitmap, { size = 512, mirror = false }: { size?: number; mirror?: boolean } = {}, ): Promise { + if (!Number.isInteger(size) || size <= 0) { + throw new Error('Avatar size must be a positive integer'); + } const side = Math.min(source.width, source.height); if (side === 0) { // A not-yet-decoded