Skip to content

Commit

Permalink
fix: yaml worker errors at undefined row/column
Browse files Browse the repository at this point in the history
  • Loading branch information
akoreman committed Dec 1, 2023
1 parent 94d68a7 commit 06cc12a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/ace/mode/yaml_worker.js
Expand Up @@ -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
Expand Down

0 comments on commit 06cc12a

Please sign in to comment.