From 01d63f538495e61c42f71c369f6474b04d0830d1 Mon Sep 17 00:00:00 2001 From: Eric Vicenti Date: Tue, 10 Dec 2024 13:49:08 -0800 Subject: [PATCH] attempt fix publish error: .trim is not a function --- .../packages/shared/src/client/editorblock-to-hmblock.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/packages/shared/src/client/editorblock-to-hmblock.ts b/frontend/packages/shared/src/client/editorblock-to-hmblock.ts index 1140c455..414bf067 100644 --- a/frontend/packages/shared/src/client/editorblock-to-hmblock.ts +++ b/frontend/packages/shared/src/client/editorblock-to-hmblock.ts @@ -230,7 +230,12 @@ function getParentBlock(block: HMBlock) { function toNumber(value?: string): number | null { // Handle empty or whitespace-only strings - if (!value || value.trim() === '') { + if (!value) return null + if (typeof value !== 'string') { + console.error('Unexpected numeric value is not a string: ', value) + return null + } + if (value.trim() === '') { return null }