Skip to content

Commit 06cc12a

Browse files
committed
fix: yaml worker errors at undefined row/column
1 parent 94d68a7 commit 06cc12a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/ace/mode/yaml_worker.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ oop.inherits(YamlWorker, Mirror);
3434
return;
3535
}
3636

37+
// error.mark is not always defined, if undefined we default to displaying the error at the top row of the document.
38+
var markDefined = !!error.mark;
3739
errors.push({
38-
row: error.mark.line,
39-
column: error.mark.column,
40+
row: markDefined ? error.mark.line : 0,
41+
column: markDefined ? error.mark.column : 0,
4042
text: error.reason,
4143
type: 'error',
4244
raw: error

0 commit comments

Comments
 (0)