When subtitle is embedded in the main video file, the path will be null.

This commit is contained in:
Carsten Braun 2025-01-02 22:23:25 +01:00
parent e8239a7ee2
commit fcf56b73cb

View File

@ -537,7 +537,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
foreach (var subtitleStream in subtitleStreams)
{
if (!subtitleStream.Path.EndsWith(".mks", StringComparison.OrdinalIgnoreCase))
if (subtitleStream.Path is null || !subtitleStream.Path.EndsWith(".mks", StringComparison.OrdinalIgnoreCase))
{
continue;
}
@ -608,7 +608,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
foreach (var subtitleStream in subtitleStreams)
{
if (subtitleStream.Path.EndsWith(".mks", StringComparison.OrdinalIgnoreCase))
if (subtitleStream.Path is not null && subtitleStream.Path.EndsWith(".mks", StringComparison.OrdinalIgnoreCase))
{
_logger.LogDebug("Subtitle {Index} for file {InputPath} is part in an MKS file. Skipping", inputPath, subtitleStream.Index);
continue;