Critical Fix: Avatar already exists check

This commit is contained in:
memetrollsXD 2022-08-02 03:32:45 +02:00
parent a802a91173
commit 0ff5564b43
No known key found for this signature in database
GPG Key ID: 105C2F3417AC32CD

View File

@ -21,7 +21,7 @@ export default async function handle(command: Command) {
if (!avatarId) return c.log("No avatarId specified");
// Check if it already exists
const avatar = await Avatar.fromUID(uid, avatarId);
if (avatar) return c.log(`Avatar ${avatarId} already exists`);
if (avatar.length > 0) return c.log(`Avatar ${avatarId} already exists`);
Avatar.create(uid, avatarId).then(a => c.log(`Avatar ${avatarId} added to ${a.ownerUid}`));
break;
case "remove":