From b366dc2e6e5be2b93f2b6fcc4549a32b655c3806 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Thu, 13 Oct 2022 19:08:00 +0200 Subject: Use ArgumentException.ThrowIfNullOrEmpty --- Jellyfin.Api/Controllers/SessionController.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Jellyfin.Api/Controllers/SessionController.cs') diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs index 9218c3b5c..085ac808b 100644 --- a/Jellyfin.Api/Controllers/SessionController.cs +++ b/Jellyfin.Api/Controllers/SessionController.cs @@ -294,10 +294,7 @@ namespace Jellyfin.Api.Controllers { var currentSession = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false); - if (command is null) - { - throw new ArgumentException("Request body may not be null"); - } + ArgumentNullException.ThrowIfNull(command, "Request body may not be null"); command.ControllingUserId = currentSession.UserId; -- cgit v1.2.3 From e21f4adc1694b2c22413576c333a3b9e88ca2b7a Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Thu, 17 Nov 2022 22:23:11 +0100 Subject: Fix wrong usage of ArgumentNullException.ThrowIfNull --- Jellyfin.Api/Controllers/SessionController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Jellyfin.Api/Controllers/SessionController.cs') diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs index 085ac808b..25f930135 100644 --- a/Jellyfin.Api/Controllers/SessionController.cs +++ b/Jellyfin.Api/Controllers/SessionController.cs @@ -294,7 +294,7 @@ namespace Jellyfin.Api.Controllers { var currentSession = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false); - ArgumentNullException.ThrowIfNull(command, "Request body may not be null"); + ArgumentNullException.ThrowIfNull(command); command.ControllingUserId = currentSession.UserId; -- cgit v1.2.3