Skip to content

Commit

Permalink
CB-4977 return undefined if parse query call returns zeros (#2662)
Browse files Browse the repository at this point in the history
  • Loading branch information
devnaumov authored May 27, 2024
1 parent 1133112 commit c6127b0
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,11 @@ export function useSqlEditor(state: ISqlEditorTabState): ISQLEditorData {

const result = await this.sqlEditorService.parseSQLQuery(projectId, connectionId, this.value, this.cursor.begin);

const segment = this.parser.getSegment(result.start, result.end);

if (!segment) {
throw new Error('Failed to get position');
if (result.end === 0 && result.start === 0) {
return;
}

const segment = this.parser.getSegment(result.start, result.end);
return segment;
},

Expand Down

0 comments on commit c6127b0

Please sign in to comment.