Quellcode durchsuchen

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

Brian C. Arnold vor 4 Jahren
Ursprung
Commit
998833ea6e
1 geänderte Dateien mit 1 neuen und 5 gelöschten Zeilen
  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)]
         [ProducesResponseType(StatusCodes.Status204NoContent)]
         public ActionResult SendMessageCommand(
         public ActionResult SendMessageCommand(
             [FromRoute, Required] string sessionId,
             [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.
             // 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))
             if (string.IsNullOrWhiteSpace(command.Text))