fix(server): エクスポートした絵文字の拡張子がfalseになることがあるのを修正

This commit is contained in:
syuilo 2021-12-29 17:04:13 +09:00
parent b14e347da1
commit 3e00ce0d88

View File

@ -65,7 +65,8 @@ export async function exportCustomEmojis(job: Bull.Job, done: () => void): Promi
for (const emoji of customEmojis) { for (const emoji of customEmojis) {
const exportId = ulid().toLowerCase(); const exportId = ulid().toLowerCase();
const emojiPath = path + '/' + exportId + '.' + mime.extension(emoji.type); const ext = mime.extension(emoji.type);
const emojiPath = path + '/' + exportId + (ext ? '.' + ext : '');
fs.writeFileSync(emojiPath, '', 'binary'); fs.writeFileSync(emojiPath, '', 'binary');
let downloaded = false; let downloaded = false;