Explorar o código

Removed null check for body object and user [Required] attribute in replacement.

Brian C. Arnold %!s(int64=4) %!d(string=hai) anos
pai
achega
998833ea6e
Modificáronse 1 ficheiros con 1 adicións e 5 borrados
  1. 1 5
      Jellyfin.Api/Controllers/SessionController.cs

+ 1 - 5
Jellyfin.Api/Controllers/SessionController.cs

@@ -321,12 +321,8 @@ namespace Jellyfin.Api.Controllers
         [ProducesResponseType(StatusCodes.Status204NoContent)]
         public ActionResult SendMessageCommand(
             [FromRoute, Required] string sessionId,
-            [FromBody] MessageCommand command)
+            [FromBody, Required] MessageCommand command)
         {
-            if (command == null)
-            {
-                throw new ArgumentException("Request body may not be null");
-            }
 
             // Need to check if message.Text is null, since [Required] can't be applied to properties of a deserialized object.
             if (string.IsNullOrWhiteSpace(command.Text))