aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-11-13 11:14:44 -0700
committercrobibero <cody@robibe.ro>2020-11-13 11:14:44 -0700
commit5f52a58e785fa4ae06fa07a93b81c1e7547ac9f3 (patch)
tree68466ae2c11051e631a4cf06a43cf14da1f4d756 /Jellyfin.Api/Helpers/TranscodingJobHelper.cs
parentbe312f992d92433e3e7619e264889d1a0afadf26 (diff)
Convert NullReferenceException to ResourceNotFoundException
Diffstat (limited to 'Jellyfin.Api/Helpers/TranscodingJobHelper.cs')
-rw-r--r--Jellyfin.Api/Helpers/TranscodingJobHelper.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
index b72e33af3..4ec0c576a 100644
--- a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
+++ b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
@@ -12,6 +12,7 @@ using Jellyfin.Api.Models.PlaybackDtos;
using Jellyfin.Api.Models.StreamingDtos;
using Jellyfin.Data.Enums;
using MediaBrowser.Common.Configuration;
+using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
@@ -198,7 +199,7 @@ namespace Jellyfin.Api.Helpers
var job = (TranscodingJobDto?)state;
if (job == null)
{
- throw new NullReferenceException(nameof(job));
+ throw new ResourceNotFoundException(nameof(job));
}
if (!job.HasExited && job.Type != TranscodingJobType.Progressive)
@@ -496,7 +497,7 @@ namespace Jellyfin.Api.Helpers
var directory = Path.GetDirectoryName(outputPath);
if (directory == null)
{
- throw new NullReferenceException(nameof(directory));
+ throw new ResourceNotFoundException(nameof(directory));
}
Directory.CreateDirectory(directory);