summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-04-18 21:41:22 +0100
committersr55 <[email protected]>2016-04-18 21:41:22 +0100
commitabce2df0a9c264e17fa262ed1b5f0494a2f60d08 (patch)
treec1562f132e528ef5e2d57085b4298cad76055f31 /win/CS/HandBrakeWPF
parentc05974837c1222f3a0f2d0bcf9c41fbe6d8b0a08 (diff)
WinGui: Small code optimisation in the QueueRecoveryHelper
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
index 04274e791..1cbc352f3 100644
--- a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
@@ -45,13 +45,18 @@ namespace HandBrakeWPF.Helpers
{
try
{
- XmlSerializer Ser = new XmlSerializer(typeof(List<QueueTask>));
string tempPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\");
List<string> queueFiles = new List<string>();
- List<string> removeFiles = new List<string>();
-
DirectoryInfo info = new DirectoryInfo(tempPath);
IEnumerable<FileInfo> logFiles = info.GetFiles("*.xml").Where(f => f.Name.StartsWith("hb_queue_recovery"));
+
+ if (!logFiles.Any())
+ {
+ return queueFiles;
+ }
+
+ List<string> removeFiles = new List<string>();
+ XmlSerializer Ser = new XmlSerializer(typeof(List<QueueTask>));
foreach (FileInfo file in logFiles)
{
try