Fix nullrefexception in SubtitleEncoder

This commit is contained in:
Bond_009 2019-01-04 18:46:52 +01:00
parent c6618d0a5f
commit 59d8d9a82c
2 changed files with 14 additions and 3 deletions

View File

@ -160,9 +160,9 @@ namespace Emby.Server.Implementations.Library
list.Add(source); list.Add(source);
} }
foreach (var source in list)
{
if (user != null) if (user != null)
{
foreach (var source in list)
{ {
if (string.Equals(item.MediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase)) if (string.Equals(item.MediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase))
{ {

View File

@ -37,7 +37,17 @@ namespace MediaBrowser.MediaEncoding.Subtitles
private readonly IProcessFactory _processFactory; private readonly IProcessFactory _processFactory;
private readonly ITextEncoding _textEncoding; private readonly ITextEncoding _textEncoding;
public SubtitleEncoder(ILibraryManager libraryManager, ILogger logger, IApplicationPaths appPaths, IFileSystem fileSystem, IMediaEncoder mediaEncoder, IJsonSerializer json, IHttpClient httpClient, IMediaSourceManager mediaSourceManager, IProcessFactory processFactory, ITextEncoding textEncoding) public SubtitleEncoder(
ILibraryManager libraryManager,
ILogger logger,
IApplicationPaths appPaths,
IFileSystem fileSystem,
IMediaEncoder mediaEncoder,
IJsonSerializer json,
IHttpClient httpClient,
IMediaSourceManager mediaSourceManager,
IProcessFactory processFactory,
ITextEncoding textEncoding)
{ {
_libraryManager = libraryManager; _libraryManager = libraryManager;
_logger = logger; _logger = logger;
@ -46,6 +56,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
_mediaEncoder = mediaEncoder; _mediaEncoder = mediaEncoder;
_json = json; _json = json;
_httpClient = httpClient; _httpClient = httpClient;
_mediaSourceManager = mediaSourceManager;
_processFactory = processFactory; _processFactory = processFactory;
_textEncoding = textEncoding; _textEncoding = textEncoding;
} }