From 549f256524a3ca6fac76ff69424ad50857203879 Mon Sep 17 00:00:00 2001 From: hec <49053243+Hec-gitHub@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:27:09 +0900 Subject: [PATCH] fix(ChatData): Fix execution failure error after manually updating SQL (#1812) Co-authored-by: hec --- web/components/chat/db-editor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/components/chat/db-editor.tsx b/web/components/chat/db-editor.tsx index 63b8e1149..59ba5645d 100644 --- a/web/components/chat/db-editor.tsx +++ b/web/components/chat/db-editor.tsx @@ -460,7 +460,7 @@ function DbEditor() { if (!value) { return { sql: '', thoughts: '' }; } - const match = value && value.match(/(--.*)\n([\s\S]*)/); + const match = value && value.match(/(--.*)?\n?([\s\S]*)/); let thoughts = ''; let sql; if (match && match.length >= 3) {