From 06cc12aad98176d931a1c1cf9a701f4ac0c33de5 Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Fri, 1 Dec 2023 13:52:23 +0100 Subject: [PATCH] fix: yaml worker errors at undefined row/column --- lib/ace/mode/yaml_worker.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ace/mode/yaml_worker.js b/lib/ace/mode/yaml_worker.js index cc5dd58f162..4a9f7ec1d89 100644 --- a/lib/ace/mode/yaml_worker.js +++ b/lib/ace/mode/yaml_worker.js @@ -34,9 +34,11 @@ oop.inherits(YamlWorker, Mirror); return; } + // error.mark is not always defined, if undefined we default to displaying the error at the top row of the document. + var markDefined = !!error.mark; errors.push({ - row: error.mark.line, - column: error.mark.column, + row: markDefined ? error.mark.line : 0, + column: markDefined ? error.mark.column : 0, text: error.reason, type: 'error', raw: error