mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-16 16:05:00 +00:00
fix: OpenFolderPickerAsync
raise exception when selected a drive root such as E:\
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
1bd2044589
commit
bc5deac9fe
8 changed files with 32 additions and 9 deletions
|
@ -452,7 +452,9 @@ namespace SourceGit.ViewModels
|
|||
var selected = await storageProvider.OpenFolderPickerAsync(options);
|
||||
if (selected.Count == 1)
|
||||
{
|
||||
var saveTo = Path.Combine(selected[0].Path.LocalPath, Path.GetFileName(file.Path));
|
||||
var folder = selected[0];
|
||||
var folderPath = folder is { Path: { IsAbsoluteUri: true } path } ? path.LocalPath : folder?.Path.ToString();
|
||||
var saveTo = Path.Combine(folderPath, Path.GetFileName(file.Path));
|
||||
Commands.SaveRevisionFile.Run(_repo.FullPath, _commit.SHA, file.Path, saveTo);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue