Fix PATCHing members with one-sided proxy tags

This commit is contained in:
Ske 2019-11-03 19:16:06 +01:00
parent 378cba09e5
commit d6edbe8e8d

View File

@ -97,7 +97,7 @@ namespace PluralKit.API.Controllers
return BadRequest($"Member descriptions too long ({newMember.Description.Length} > {Limits.MaxDescriptionLength}."); return BadRequest($"Member descriptions too long ({newMember.Description.Length} > {Limits.MaxDescriptionLength}.");
// Sanity bounds checks // Sanity bounds checks
if (newMember.ProxyTags?.Any(tag => tag.Prefix.Length > 1000 || tag.Suffix.Length > 1000) ?? false) if (newMember.ProxyTags?.Any(tag => (tag.Prefix?.Length ?? 0) > 1000 || (tag.Suffix?.Length ?? 0) > 1000) ?? false)
return BadRequest(); return BadRequest();
member.Name = newMember.Name; member.Name = newMember.Name;