Skip to content

Commit

Permalink
Avoid runtime error when editor is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Danp2 committed Apr 8, 2022
1 parent 4e2bcce commit 8edf4bc
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 8edf4bc

Please sign in to comment.