aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/EnvironmentController.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2020-11-15 14:35:34 -0500
committerGitHub <noreply@github.com>2020-11-15 14:35:34 -0500
commit2f426dfc97677deffb60420078b20a7f5f03977e (patch)
tree89772dd894e735d657522105a29884d2117a5bfa /Jellyfin.Api/Controllers/EnvironmentController.cs
parent7caf1662eca2ea8826f3277e8b9d5c8c782fd03d (diff)
parent056c44010b437b0f718cb10b1ed66a7f38d61874 (diff)
Merge pull request #4458 from crobibero/dotnet-5
Upgrade to Net5
Diffstat (limited to 'Jellyfin.Api/Controllers/EnvironmentController.cs')
-rw-r--r--Jellyfin.Api/Controllers/EnvironmentController.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Jellyfin.Api/Controllers/EnvironmentController.cs b/Jellyfin.Api/Controllers/EnvironmentController.cs
index ce88b0b99..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;
@@ -103,6 +104,11 @@ namespace Jellyfin.Api.Controllers
if (validatePathDto.ValidateWritable)
{
+ if (validatePathDto.Path == null)
+ {
+ throw new ResourceNotFoundException(nameof(validatePathDto.Path));
+ }
+
var file = Path.Combine(validatePathDto.Path, Guid.NewGuid().ToString());
try
{