提交 12b7d0aa 编写于 作者: M Martin Aeschlimann

window.showOpenDialog throws "TypeError: Default path must be a string" with...

window.showOpenDialog throws "TypeError: Default path must be a string" with defaultUri = null. Fixes #84325
上级 760957c1
......@@ -33,11 +33,11 @@ export class MainThreadDialogs implements MainThreadDiaglogsShape {
private static _convertOpenOptions(options: MainThreadDialogOpenOptions): IOpenDialogOptions {
const result: IOpenDialogOptions = {
openLabel: options.openLabel,
openLabel: options.openLabel || undefined,
canSelectFiles: options.canSelectFiles || (!options.canSelectFiles && !options.canSelectFolders),
canSelectFolders: options.canSelectFolders,
canSelectMany: options.canSelectMany,
defaultUri: URI.revive(options.defaultUri)
defaultUri: options.defaultUri ? URI.revive(options.defaultUri) : undefined
};
if (options.filters) {
result.filters = [];
......@@ -48,8 +48,8 @@ export class MainThreadDialogs implements MainThreadDiaglogsShape {
private static _convertSaveOptions(options: MainThreadDialogSaveOptions): ISaveDialogOptions {
const result: ISaveDialogOptions = {
defaultUri: URI.revive(options.defaultUri),
saveLabel: options.saveLabel
defaultUri: options.defaultUri ? URI.revive(options.defaultUri) : undefined,
saveLabel: options.saveLabel || undefined
};
if (options.filters) {
result.filters = [];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册