避免下载时的可能出现的问题

croire 3 years ago
parent 093652f0d6
commit 52e36b0fd7

@ -185,7 +185,7 @@ namespace DownKyi.Services.Download
// 下载设置dialog中如果点击取消或者关闭窗口
// 会返回空字符串,
// 这时直接退出
if (directory == string.Empty) { return null; }
if (directory == null || directory == string.Empty) { return null; }
// 文件夹不存在则创建
if (!Directory.Exists(directory))

@ -56,7 +56,7 @@ namespace DownKyi.ViewModels.Dialogs
{
SetProperty(ref directory, value);
if (directory != string.Empty)
if (directory != null && directory != string.Empty)
{
DriveName = directory.Substring(0, 1).ToUpper();
DriveNameFreeSpace = Format.FormatFileSize(HardDisk.GetHardDiskFreeSpace(DriveName));
@ -381,7 +381,7 @@ namespace DownKyi.ViewModels.Dialogs
// 弹出选择下载目录的窗口
path = DialogUtils.SetDownloadDirectory();
if (path == null || path == "")
if (path == null || path == string.Empty)
{
return null;
}

Loading…
Cancel
Save