From c7f0d541c2de2b88265059334fe455d05507750f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 6 Jan 2026 10:41:50 +0200 Subject: [PATCH] fix(server): blob errors out --- apps/server/src/services/blob.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/server/src/services/blob.ts b/apps/server/src/services/blob.ts index 6804f1ecb..2f123cb03 100644 --- a/apps/server/src/services/blob.ts +++ b/apps/server/src/services/blob.ts @@ -39,7 +39,9 @@ function processContent(content: Buffer | Uint8Array | string | null, isProtecte } if (isStringContent) { - return content === null ? "" : binary_utils.decodeUtf8(content as Uint8Array); + if (content === null) return ""; + if (typeof content === "string") return content; + return binary_utils.decodeUtf8(content as Uint8Array); } // see https://github.com/zadam/trilium/issues/3523 // IIRC a zero-sized buffer can be returned as null from the database