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: {