From 9ce9a52a86499652c1bc8a665359d097bbd60ffb Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 26 Sep 2024 10:15:20 +0800 Subject: [PATCH] fix: text not string --- 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 800f61691a..20a70c34cd 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.split('\n') + const paragraph = text ? text.split('\n') : [] return JSON.stringify({ root: {