Browse Source

add error handling

Luke Pulverenti 9 years ago
parent
commit
3ebfb59456
1 changed files with 5 additions and 1 deletions
  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);
                 files = Directory.GetFiles(path, "*", SearchOption.AllDirectories);
 
 
                 ffmpegPath = files.FirstOrDefault(i => string.Equals(Path.GetFileNameWithoutExtension(i), "ffmpeg", StringComparison.OrdinalIgnoreCase));
                 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);
             return new Tuple<string, string>(ffmpegPath, ffprobePath);