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