diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-07-12 01:44:07 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-07-12 23:09:23 -0400 |
| commit | 7117f78651f21efae21c3337dab9d42a4c461a64 (patch) | |
| tree | 68c38ca9941adbea47c49e230833cbf4fe919f0f | |
| parent | 7ea5608683500615815e8b4de8f5f82f426f3dc5 (diff) | |
fix error when transcode fails to start
| -rw-r--r-- | MediaBrowser.Api/ApiEntryPoint.cs | 7 |
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)) |
