提交 302cbc14 编写于 作者: M Matt Bierner

Don't try to revive webviews without a reviver

上级 21ee81c0
...@@ -134,7 +134,14 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv ...@@ -134,7 +134,14 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
this._webviews.set(handle, webview); this._webviews.set(handle, webview);
webview._events = this.createWebviewEventDelegate(handle); webview._events = this.createWebviewEventDelegate(handle);
return this._proxy.$deserializeWebviewPanel(handle, webview.state.viewType, webview.getTitle(), JSON.parse(webview.state.state), webview.position, webview.options) let state;
try {
state = JSON.parse(webview.state.state);
} catch {
state = {};
}
return this._proxy.$deserializeWebviewPanel(handle, webview.state.viewType, webview.getTitle(), state, webview.position, webview.options)
.then(undefined, () => { .then(undefined, () => {
webview.html = MainThreadWebviews.getDeserializationFailedContents(viewType); webview.html = MainThreadWebviews.getDeserializationFailedContents(viewType);
}); });
...@@ -146,7 +153,7 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv ...@@ -146,7 +153,7 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
return false; return false;
} }
return this._revivers.has(webview.viewType) || webview.reviver !== null; return (this._revivers.has(webview.viewType) || webview.reviver !== null) && webview.state.state;
} }
private _onWillShutdown(): TPromise<boolean> { private _onWillShutdown(): TPromise<boolean> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册