DRY-ify checking URL length for avatars

This commit is contained in:
spiral
2020-11-22 15:43:38 -05:00
parent 7f82a3e63a
commit 05f1ee92ea
4 changed files with 4 additions and 12 deletions

View File

@@ -140,8 +140,6 @@ namespace PluralKit.Bot
async Task SetIcon(ParsedImage img)
{
if (img.Url.Length > Limits.MaxUriLength)
throw Errors.InvalidUrl(img.Url);
await AvatarUtils.VerifyAvatarOrThrow(img.Url);
await _db.Execute(c => _repo.UpdateSystem(c, ctx.System.Id, new SystemPatch {AvatarUrl = img.Url}));