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 23:09:23 -0400
commit7117f78651f21efae21c3337dab9d42a4c461a64 (patch)
tree68c38ca9941adbea47c49e230833cbf4fe919f0f
parent7ea5608683500615815e8b4de8f5f82f426f3dc5 (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))