mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 22:12:26 +01:00
Handle a few edge cases where extension host may try accessing a disposed webview
This commit is contained in:
@@ -100,6 +100,10 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
|
||||
|
||||
$reveal(handle: WebviewPanelHandle, column: Position | undefined): void {
|
||||
const webview = this.getWebview(handle);
|
||||
if (webview.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._webviewService.revealWebview(webview, column);
|
||||
}
|
||||
|
||||
@@ -140,6 +144,10 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
|
||||
}
|
||||
|
||||
canRevive(webview: WebviewEditorInput): boolean {
|
||||
if (webview.isDisposed()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this._revivers.has(webview.viewType) || webview.reviver !== null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user