Explorar el Código

Check for attachment file before trying to remove it during cleanup.

Andrew Mahone hace 5 años
padre
commit
c09eb34708
Se han modificado 1 ficheros con 4 adiciones y 5 borrados
  1. 4 5
      MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs

+ 4 - 5
MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs

@@ -220,11 +220,10 @@ namespace MediaBrowser.MediaEncoding.Attachments
                 _logger.LogWarning("Deleting extracted attachment {Path} due to failure: {ExitCode}", outputPath, exitCode);
                 try
                 {
-                    _fileSystem.DeleteFile(outputPath);
-                }
-                catch (FileNotFoundException)
-                {
-
+                    if (File.Exists(outputPath))
+                    {
+                        _fileSystem.DeleteFile(outputPath);
+                    }
                 }
                 catch (IOException ex)
                 {