Skip to content

Commit 5b98f71

Browse files
committed
Fix webview deserialization potential crash
1 parent 6e142bc commit 5b98f71

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/vs/workbench/api/node/extHostWebview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
333333
}
334334

335335
const webview = new ExtHostWebview(webviewHandle, this._proxy, options);
336-
const revivedPanel = new ExtHostWebviewPanel(webviewHandle, this._proxy, viewType, title, typeof position === 'number' ? typeConverters.ViewColumn.to(position) : undefined, options, webview);
336+
const revivedPanel = new ExtHostWebviewPanel(webviewHandle, this._proxy, viewType, title, typeof position === 'number' && position >= 0 ? typeConverters.ViewColumn.to(position) : undefined, options, webview);
337337
this._webviewPanels.set(webviewHandle, revivedPanel);
338338
return Promise.resolve(serializer.deserializeWebviewPanel(revivedPanel, state));
339339
}

0 commit comments

Comments
 (0)