aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2019-01-27 17:00:17 +0100
committerBond_009 <bond.009@outlook.com>2019-01-27 17:00:17 +0100
commitffe79c89829fb232e8ccb4ae4caf4b732ce51600 (patch)
tree6938e3f5ebae59fe4baec81e4583abbef3371dae /Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs
parent1a3543e5a5984d4ec5284f43b7df63a9d19c8a9c (diff)
Check if file exists instead of catching exceptions
Diffstat (limited to 'Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs')
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs21
1 files changed, 12 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs b/Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs
index 0ae7ae96c..57bc61c7a 100644
--- a/Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs
@@ -101,17 +101,20 @@ namespace Emby.Server.Implementations.ScheduledTasks
List<string> previouslyFailedImages;
- try
+ if (File.Exists(failHistoryPath))
{
- previouslyFailedImages = _fileSystem.ReadAllText(failHistoryPath)
- .Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries)
- .ToList();
- }
- catch (FileNotFoundException)
- {
- previouslyFailedImages = new List<string>();
+ try
+ {
+ previouslyFailedImages = _fileSystem.ReadAllText(failHistoryPath)
+ .Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries)
+ .ToList();
+ }
+ catch (IOException)
+ {
+ previouslyFailedImages = new List<string>();
+ }
}
- catch (IOException)
+ else
{
previouslyFailedImages = new List<string>();
}