Skip to content

Commit a9bc070

Browse files
committed
fix for FRT test
1 parent f3e1fe2 commit a9bc070

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/platform/packages/shared/kbn-esql-utils/src/utils/query_parsing_helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export const getValuesFromQueryField = (queryString: string, cursorPosition?: mo
438438
const lastCommand = root.commands[root.commands.length - 1];
439439
const fields: Array<ESQLColumn | PromQLLabel> = [];
440440

441-
if (lastCommand.name === 'promql') {
441+
if (lastCommand?.name === 'promql') {
442442
// Empty `{agent=}` loses its label; reopen so the `""` below keeps it.
443443
const validPromqlQuery = queryInCursorPosition.replace(TRAILING_CLOSERS_REGEX, '');
444444
const { root: promqlRoot } = Parser.parse(correctPromqlQuerySyntax(`${validPromqlQuery} ""`));

0 commit comments

Comments
 (0)