Convert NullReferenceException to ResourceNotFoundException

This commit is contained in:
crobibero
2020-11-13 11:14:44 -07:00
parent be312f992d
commit 5f52a58e78
18 changed files with 40 additions and 27 deletions

View File

@@ -11,6 +11,7 @@ using Jellyfin.Api.Helpers;
using Jellyfin.Api.Models.PlaybackDtos;
using Jellyfin.Api.Models.StreamingDtos;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Dlna;
@@ -364,7 +365,7 @@ namespace Jellyfin.Api.Controllers
var directory = Path.GetDirectoryName(outputPath);
if (directory == null)
{
throw new NullReferenceException(nameof(directory));
throw new ResourceNotFoundException(nameof(directory));
}
var outputTsArg = Path.Combine(directory, Path.GetFileNameWithoutExtension(outputPath)) + "%d" + format;