소스 검색

add error handling

Luke Pulverenti 9 년 전
부모
커밋
3ebfb59456
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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);