mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Fix possible webview exception
This commit is contained in:
@@ -252,6 +252,9 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
|
||||
webviewHandle: WebviewHandle
|
||||
): Thenable<any> {
|
||||
const webview = this.getWebview(webviewHandle);
|
||||
if (!webview) {
|
||||
return TPromise.as(undefined);
|
||||
}
|
||||
|
||||
const serialzer = this._serializers.get(webview.viewType);
|
||||
if (!serialzer) {
|
||||
@@ -261,7 +264,7 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
|
||||
return serialzer.serializeWebview(webview);
|
||||
}
|
||||
|
||||
private getWebview(handle: WebviewHandle) {
|
||||
private getWebview(handle: WebviewHandle): ExtHostWebview | undefined {
|
||||
return this._webviews.get(handle);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user