Skip to content

Commit e8674fc

Browse files
authored
Merge pull request #5409 from akoreman/yaml_worker_fix
fix: yaml worker errors at undefined row/column
2 parents 3a58eb3 + 06cc12a commit e8674fc

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)