Skip to content

Commit 1d9c81b

Browse files
author
floatwork_jan
committed
improve error handling
1 parent 8949ce2 commit 1d9c81b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v0.18.1 [#](https://github.com/idleberg/vscode-applescript/releases/tag/v0.18.1)
2+
3+
- improve error handling in `getLineCol()`
4+
15
# v0.18.0 [#](https://github.com/idleberg/vscode-applescript/releases/tag/v0.18.0)
26

37
- add option to convert error range to line/column

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const getLineCol = (lineString: string) => {
1616
const re = /^(?<filePath>[^:]+):(?<rangeFrom>\d+):((?<rangeTo>\d+):)?(?<message>.*)$/u;
1717
const result = re.exec(lineString);
1818

19-
if (!result.groups.rangeFrom) return false;
19+
if (!result || !result.groups.rangeFrom) return false;
2020

2121
const editorText = window.activeTextEditor.document.getText();
2222
const fileName = window.activeTextEditor.document.fileName;

0 commit comments

Comments
 (0)