From 7ee5cc80a2eb910181b302e1ab8af9c2a2e06a29 Mon Sep 17 00:00:00 2001 From: crazywoola <100913391+crazywoola@users.noreply.github.com> Date: Fri, 11 Apr 2025 11:37:47 +0800 Subject: [PATCH] fix: text.split (#17842) --- web/app/components/base/prompt-editor/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/components/base/prompt-editor/utils.ts b/web/app/components/base/prompt-editor/utils.ts index 6d7d636e55..4b2570e697 100644 --- a/web/app/components/base/prompt-editor/utils.ts +++ b/web/app/components/base/prompt-editor/utils.ts @@ -296,7 +296,7 @@ export function $splitNodeContainingQuery(match: MenuTextMatch): TextNode | null } export function textToEditorState(text: string) { - const paragraph = text ? text.split('\n') : [''] + const paragraph = text && (typeof text === 'string') ? text.split('\n') : [''] return JSON.stringify({ root: {