Explorar el Código

add error handling

Luke Pulverenti hace 9 años
padre
commit
3ebfb59456
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

+ 5 - 1
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

@@ -322,7 +322,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
                 files = Directory.GetFiles(path, "*", SearchOption.AllDirectories);
 
                 ffmpegPath = files.FirstOrDefault(i => string.Equals(Path.GetFileNameWithoutExtension(i), "ffmpeg", StringComparison.OrdinalIgnoreCase));
-                ffprobePath = GetProbePathFromEncoderPath(ffmpegPath);
+
+                if (!string.IsNullOrWhiteSpace(ffmpegPath))
+                {
+                    ffprobePath = GetProbePathFromEncoderPath(ffmpegPath);
+                }
             }
 
             return new Tuple<string, string>(ffmpegPath, ffprobePath);