diff --git a/web/components/chat/db-editor.tsx b/web/components/chat/db-editor.tsx index b790f6954..c8f36fe4c 100644 --- a/web/components/chat/db-editor.tsx +++ b/web/components/chat/db-editor.tsx @@ -463,7 +463,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) {