修复DownloadBase为空时崩溃的问题

croire 4 years ago
parent 6f21977c8f
commit f6536284e9

@ -84,6 +84,8 @@ namespace DownKyi.ViewModels.DownloadManager
/// </summary> /// </summary>
private void ExecuteOpenFolderCommand() private void ExecuteOpenFolderCommand()
{ {
if (DownloadBase == null) { return; }
string videoPath = $"{DownloadBase.FilePath}.mp4"; string videoPath = $"{DownloadBase.FilePath}.mp4";
FileInfo fileInfo = new FileInfo(videoPath); FileInfo fileInfo = new FileInfo(videoPath);
if (File.Exists(fileInfo.FullName)) if (File.Exists(fileInfo.FullName))
@ -105,6 +107,8 @@ namespace DownKyi.ViewModels.DownloadManager
/// </summary> /// </summary>
private void ExecuteOpenVideoCommand() private void ExecuteOpenVideoCommand()
{ {
if (DownloadBase == null) { return; }
string videoPath = $"{DownloadBase.FilePath}.mp4"; string videoPath = $"{DownloadBase.FilePath}.mp4";
var fileInfo = new FileInfo(videoPath); var fileInfo = new FileInfo(videoPath);
if (File.Exists(fileInfo.FullName)) if (File.Exists(fileInfo.FullName))

Loading…
Cancel
Save