From cc317d845104a07ee79a95a3dfc5f8e3153dac9d Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Fri, 7 Nov 2025 10:43:57 +0100 Subject: [PATCH] Sanity check on KV key building (checking for string type) --- client/data/indexeddb_kv_primitives.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/data/indexeddb_kv_primitives.ts b/client/data/indexeddb_kv_primitives.ts index 448c3b64..8a94b447 100644 --- a/client/data/indexeddb_kv_primitives.ts +++ b/client/data/indexeddb_kv_primitives.ts @@ -83,6 +83,9 @@ export class IndexedDBKvPrimitives implements KvPrimitives { private buildKey(key: KvKey): string { for (const k of key) { + if (typeof k !== "string") { + throw new Error(`Key needs to consists of strings: ${key}`); + } if (k.includes(sep)) { throw new Error(`Key cannot contain ${sep}`); }