Added Required attribute to Text property of MessageCommand.

This commit is contained in:
Brian Arnold
2021-03-29 10:10:44 -04:00
parent 998833ea6e
commit ca25301e64
2 changed files with 3 additions and 8 deletions

View File

@@ -323,13 +323,6 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] string sessionId,
[FromBody, Required] MessageCommand command)
{
// 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))
{
throw new ArgumentNullException("Message Text may not be empty.");
}
var nullCorrectedCommand = new MessageCommand
{
Header = string.IsNullOrWhiteSpace(command.Header) ? "Message from Server" : command.Header,