mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-29 20:24:47 +03:00
Check if file exists instead of catching exceptions
This commit is contained in:
@@ -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();
|
||||
try
|
||||
{
|
||||
previouslyFailedImages = _fileSystem.ReadAllText(failHistoryPath)
|
||||
.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.ToList();
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
previouslyFailedImages = new List<string>();
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
previouslyFailedImages = new List<string>();
|
||||
}
|
||||
catch (IOException)
|
||||
else
|
||||
{
|
||||
previouslyFailedImages = new List<string>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user