namespace HandBrakeWPF.ViewModels\r
{\r
using System;\r
+ using System.Diagnostics;\r
using System.IO;\r
\r
using Caliburn.Micro;\r
return filePath;\r
}\r
\r
+ // Check if the parent directory still exists.\r
+ if (!string.IsNullOrEmpty(filePath) )\r
+ {\r
+ try\r
+ {\r
+ DirectoryInfo parentDirectory = Directory.GetParent(filePath);\r
+ if (parentDirectory != null && filePath.Contains(parentDirectory.FullName))\r
+ {\r
+ return parentDirectory.FullName;\r
+ }\r
+ }\r
+ catch (Exception exc)\r
+ {\r
+ Debug.WriteLine(exc);\r
+ }\r
+ }\r
+\r
return null;\r
}\r
\r