Skip to content

Commit 508366e

Browse files
committed
Fix null deref when activeEditor is undefined
Fixes microsoft#44009
1 parent ac6efe3 commit 508366e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/vs/workbench/api/electron-browser/mainThreadWebview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export class MainThreadWebview implements MainThreadWebviewShape {
346346
private onEditorsChanged() {
347347
const activeEditor = this._editorService.getActiveEditor();
348348
let newActiveWebview: WebviewInput | undefined = undefined;
349-
if (activeEditor.input instanceof WebviewInput) {
349+
if (activeEditor && activeEditor.input instanceof WebviewInput) {
350350
for (const handle of map.keys(this._webviews)) {
351351
const input = this._webviews.get(handle);
352352
if (input.matches(activeEditor.input)) {

0 commit comments

Comments
 (0)