aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-07-12 01:44:07 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-07-12 01:44:07 -0400
commitc29e2099cdde462d433068732070b5ab79b27728 (patch)
tree45f687bcbd7720832cf2b192acc9f229c53ee8bc
parent58d904a51a96bc15288b2ff0f99c87cdcb44728a (diff)
fix error when transcode fails to start
-rw-r--r--MediaBrowser.Api/ApiEntryPoint.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs
index a677bc600..dc811812a 100644
--- a/MediaBrowser.Api/ApiEntryPoint.cs
+++ b/MediaBrowser.Api/ApiEntryPoint.cs
@@ -237,9 +237,12 @@ namespace MediaBrowser.Api
{
lock (_activeTranscodingJobs)
{
- var job = _activeTranscodingJobs.First(j => j.Type == type && string.Equals(j.Path, path, StringComparison.OrdinalIgnoreCase));
+ var job = _activeTranscodingJobs.FirstOrDefault(j => j.Type == type && string.Equals(j.Path, path, StringComparison.OrdinalIgnoreCase));
- _activeTranscodingJobs.Remove(job);
+ if (job != null)
+ {
+ _activeTranscodingJobs.Remove(job);
+ }
}
if (!string.IsNullOrWhiteSpace(state.Request.DeviceId))