From 72031e49fc754a470171c79c9ead9f040037fbba Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 12 Apr 2023 16:10:17 +0900 Subject: [PATCH] Update CustomEmojiService.ts --- packages/backend/src/core/CustomEmojiService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts index c66eaf7ad..072dab7ce 100644 --- a/packages/backend/src/core/CustomEmojiService.ts +++ b/packages/backend/src/core/CustomEmojiService.ts @@ -45,6 +45,7 @@ export class CustomEmojiService { fetcher: () => this.emojisRepository.find({ where: { host: IsNull() } }).then(emojis => new Map(emojis.map(emoji => [emoji.name, emoji]))), toRedisConverter: (value) => JSON.stringify(Array.from(value.values())), fromRedisConverter: (value) => { + if (!Array.isArray(JSON.parse(value))) return undefined; // 古いバージョンの壊れたキャッシュが残っていることがある(そのうち消す) return new Map(JSON.parse(value).map((x) => [x.name, { ...x, updatedAt: new Date(x.updatedAt),