aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-12-22 10:58:31 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-12-22 10:58:31 -0500
commitf8c88aa632a91f3ca497fcb762f358410a490379 (patch)
tree9b6d893f5a8fb709fe20b3852790c722132871a4
parent94451de6d2730e028724b16ac6fbc1b0dfb86ff5 (diff)
add null checks
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 23e63dad0..116a6a7cf 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -95,6 +95,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
int defaultImageExtractionTimeoutMs,
bool enableEncoderFontFile, IEnvironmentInfo environmentInfo)
{
+ if (jsonSerializer == null)
+ {
+ throw new ArgumentNullException("jsonSerializer");
+ }
+
_logger = logger;
_jsonSerializer = jsonSerializer;
ConfigurationManager = configurationManager;
@@ -632,7 +637,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
var result = _jsonSerializer.DeserializeFromStream<InternalMediaInfoResult>(process.StandardOutput.BaseStream);
- if (result.streams == null && result.format == null)
+ if (result == null || (result.streams == null && result.format == null))
{
throw new Exception("ffprobe failed - streams and format are both null.");
}