提交 eaa1fe40 编写于 作者: M Matt Bierner

Fix possible undefined reference in managedFileContext

Fixes #39413
上级 a22a8ca8
...@@ -31,10 +31,12 @@ export default class ManagedFileContextManager { ...@@ -31,10 +31,12 @@ export default class ManagedFileContextManager {
this.onDidChangeActiveTextEditorSub.dispose(); this.onDidChangeActiveTextEditorSub.dispose();
} }
private onDidChangeActiveTextEditor(editor: vscode.TextEditor): any { private onDidChangeActiveTextEditor(editor?: vscode.TextEditor): any {
if (editor) {
const isManagedFile = isSupportedLanguageMode(editor.document) && this.normalizePath(editor.document.uri) !== null; const isManagedFile = isSupportedLanguageMode(editor.document) && this.normalizePath(editor.document.uri) !== null;
this.updateContext(isManagedFile); this.updateContext(isManagedFile);
} }
}
private updateContext(newValue: boolean) { private updateContext(newValue: boolean) {
if (newValue === this.isInManagedFileContext) { if (newValue === this.isInManagedFileContext) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册