diff options
| author | crobibero <cody@robibe.ro> | 2020-11-13 09:04:31 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-11-13 09:04:31 -0700 |
| commit | 01355e049855a21b69e7e258599c3fa35965375a (patch) | |
| tree | 3335a82c2fb40203ccdea697e00a0cafd3dc4ed3 /Jellyfin.Api/Controllers/VideoHlsController.cs | |
| parent | e8675a6c24ebb86ce4a48f208f439f42267bf8e6 (diff) | |
Fix nullability errors in Jellyfin.Api (part 1)
Diffstat (limited to 'Jellyfin.Api/Controllers/VideoHlsController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/VideoHlsController.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/VideoHlsController.cs b/Jellyfin.Api/Controllers/VideoHlsController.cs index d7bcf79c1..517239966 100644 --- a/Jellyfin.Api/Controllers/VideoHlsController.cs +++ b/Jellyfin.Api/Controllers/VideoHlsController.cs @@ -361,7 +361,13 @@ namespace Jellyfin.Api.Controllers var threads = _encodingHelper.GetNumberOfThreads(state, _encodingOptions, videoCodec); var inputModifier = _encodingHelper.GetInputModifier(state, _encodingOptions); var format = !string.IsNullOrWhiteSpace(state.Request.SegmentContainer) ? "." + state.Request.SegmentContainer : ".ts"; - var outputTsArg = Path.Combine(Path.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d" + format; + var directory = Path.GetDirectoryName(outputPath); + if (directory == null) + { + throw new NullReferenceException(nameof(directory)); + } + + var outputTsArg = Path.Combine(directory, Path.GetFileNameWithoutExtension(outputPath)) + "%d" + format; var segmentFormat = format.TrimStart('.'); if (string.Equals(segmentFormat, "ts", StringComparison.OrdinalIgnoreCase)) |
