summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs
index 54da681dc..13396a676 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs
@@ -10,6 +10,7 @@
namespace HandBrakeWPF.ViewModels
{
using System;
+ using System.Diagnostics;
using System.IO;
using Caliburn.Micro;
@@ -94,6 +95,23 @@ namespace HandBrakeWPF.ViewModels
return filePath;
}
+ // Check if the parent directory still exists.
+ if (!string.IsNullOrEmpty(filePath) )
+ {
+ try
+ {
+ DirectoryInfo parentDirectory = Directory.GetParent(filePath);
+ if (parentDirectory != null && filePath.Contains(parentDirectory.FullName))
+ {
+ return parentDirectory.FullName;
+ }
+ }
+ catch (Exception exc)
+ {
+ Debug.WriteLine(exc);
+ }
+ }
+
return null;
}