aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/EnvironmentController.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/Controllers/EnvironmentController.cs
parentbe312f992d92433e3e7619e264889d1a0afadf26 (diff)
Convert NullReferenceException to ResourceNotFoundException
Diffstat (limited to 'Jellyfin.Api/Controllers/EnvironmentController.cs')
-rw-r--r--Jellyfin.Api/Controllers/EnvironmentController.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/EnvironmentController.cs b/Jellyfin.Api/Controllers/EnvironmentController.cs
index 8de217bbf..6dd536254 100644
--- a/Jellyfin.Api/Controllers/EnvironmentController.cs
+++ b/Jellyfin.Api/Controllers/EnvironmentController.cs
@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using Jellyfin.Api.Constants;
using Jellyfin.Api.Models.EnvironmentDtos;
+using MediaBrowser.Common.Extensions;
using MediaBrowser.Model.IO;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
@@ -105,7 +106,7 @@ namespace Jellyfin.Api.Controllers
{
if (validatePathDto.Path == null)
{
- throw new NullReferenceException(nameof(validatePathDto.Path));
+ throw new ResourceNotFoundException(nameof(validatePathDto.Path));
}
var file = Path.Combine(validatePathDto.Path, Guid.NewGuid().ToString());