Skip to content

Commit

Permalink
Check if path is file (#17500)
Browse files Browse the repository at this point in the history
  • Loading branch information
zii-dmg authored and maxkatz6 committed Nov 14, 2024
1 parent 3f81e29 commit 9c5e639
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Avalonia.X11/NativeDialogs/GtkNativeFileDialogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public override async Task<IReadOnlyList<IStorageFile>> OpenFilePickerAsync(File
var res = await ShowDialog(options.Title, _window, GtkFileChooserAction.Open,
options.AllowMultiple, options.SuggestedStartLocation, null, options.FileTypeFilter, null, false)
.ConfigureAwait(false);
return res?.Select(f => new BclStorageFile(new FileInfo(f))).ToArray() ?? Array.Empty<IStorageFile>();
return res?.Where(f => File.Exists(f)).Select(f => new BclStorageFile(new FileInfo(f))).ToArray() ?? Array.Empty<IStorageFile>();
});
}

Expand Down

0 comments on commit 9c5e639

Please sign in to comment.