Skip to content

Commit

Permalink
Merge pull request #83 from Danp2/dp_fixruntime
Browse files Browse the repository at this point in the history
Avoid runtime error when editor is null
  • Loading branch information
loganch authored Apr 14, 2022
2 parents 289dfe5 + 8edf4bc commit d535585
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ const activate = ctx => {

vscode.workspace.onDidSaveTextDocument(document => checkAutoItCode(document));
vscode.workspace.onDidOpenTextDocument(document => checkAutoItCode(document));
vscode.window.onDidChangeActiveTextEditor(editor => checkAutoItCode(editor.document));

vscode.window.onDidChangeActiveTextEditor(editor => {
if (editor) {
checkAutoItCode(editor.document)
}
});

// eslint-disable-next-line no-console
console.log('AutoIt is now active!');
};
Expand Down

0 comments on commit d535585

Please sign in to comment.