浏览代码

Only delete cache file if exist

Cody Robibero 3 年之前
父节点
当前提交
65c47c79da
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs

+ 6 - 1
Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs

@@ -79,7 +79,12 @@ namespace Emby.Server.Implementations.LiveTv.Listings
                 return UnzipIfNeeded(info.Path, cacheFile);
             }
 
-            File.Delete(cacheFile);
+            // Must check if file exists as parent directory may not exist.
+            if (File.Exists(cacheFile))
+            {
+                File.Delete(cacheFile);
+            }
+
             _logger.LogInformation("Downloading xmltv listings from {Path}", info.Path);
 
             Directory.CreateDirectory(Path.GetDirectoryName(cacheFile));