From 62b2c31655c87d21203a7c8e7d87b3543560f4d5 Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Mon, 25 Sep 2023 05:16:13 +0200 Subject: [PATCH] upd: return empty list on empty custom emoji --- packages/megalodon/src/misskey.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index 0ea66cb49a..4807fcdfbf 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -2178,7 +2178,7 @@ export default class Misskey implements MegalodonInterface { public async getInstanceCustomEmojis(): Promise>> { return this.client .get<{ emojis: Array }>('/api/emojis') - .then(res => ({ ...res, data: res.data.emojis.map(e => MisskeyAPI.Converter.emoji(e)) })) + .then(res => ({ ...res, data: res.data.emojis && res.data.emojis.length > 0 ? res.data.emojis.map(e => MisskeyAPI.Converter.emoji(e)) : [] })) } // ======================================