fix: missing checkownsystem in pk;s icon

This commit is contained in:
spiral 2021-12-24 19:28:46 -05:00
parent 2c4fbf249f
commit 50f9465826
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31

View File

@ -81,8 +81,6 @@ public class SystemEdit
if (isOwnSystem) if (isOwnSystem)
noDescriptionSetMessage += " To set one, type `pk;s description <description>`."; noDescriptionSetMessage += " To set one, type `pk;s description <description>`.";
ctx.CheckSystem().CheckOwnSystem(target);
if (ctx.MatchRaw()) if (ctx.MatchRaw())
{ {
if (target.Description == null) if (target.Description == null)
@ -345,9 +343,6 @@ public class SystemEdit
public async Task Avatar(Context ctx, PKSystem target) public async Task Avatar(Context ctx, PKSystem target)
{ {
if (target == null)
ctx.CheckSystem();
async Task ClearIcon() async Task ClearIcon()
{ {
ctx.CheckOwnSystem(target); ctx.CheckOwnSystem(target);
@ -358,6 +353,8 @@ public class SystemEdit
async Task SetIcon(ParsedImage img) async Task SetIcon(ParsedImage img)
{ {
ctx.CheckOwnSystem(target);
await AvatarUtils.VerifyAvatarOrThrow(_client, img.Url); await AvatarUtils.VerifyAvatarOrThrow(_client, img.Url);
await _repo.UpdateSystem(target.Id, new SystemPatch { AvatarUrl = img.Url }); await _repo.UpdateSystem(target.Id, new SystemPatch { AvatarUrl = img.Url });