mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
window.showOpenDialog throws "TypeError: Default path must be a string" with defaultUri = null. Fixes #84325
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user