Fix null deref when activeEditor is undefined

Fixes #44009
This commit is contained in:
Matt Bierner
2018-02-20 11:18:27 -08:00
parent ac6efe34cf
commit 508366e3fc

View File

@@ -346,7 +346,7 @@ export class MainThreadWebview implements MainThreadWebviewShape {
private onEditorsChanged() {
const activeEditor = this._editorService.getActiveEditor();
let newActiveWebview: WebviewInput | undefined = undefined;
if (activeEditor.input instanceof WebviewInput) {
if (activeEditor && activeEditor.input instanceof WebviewInput) {
for (const handle of map.keys(this._webviews)) {
const input = this._webviews.get(handle);
if (input.matches(activeEditor.input)) {