From 15c81749b8c1ef68ec6fd96ca4b2eb98041cb9ab Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 9 Oct 2023 19:09:33 +0300 Subject: [PATCH] Filter out invalid/broken characters --- server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.js b/server.js index b769ee605..03cd45014 100644 --- a/server.js +++ b/server.js @@ -1350,6 +1350,12 @@ app.post("/getcharacters", jsonParser, function (request, response) { let processingPromises = pngFiles.map((file, index) => processCharacter(file, index)); await Promise.all(processingPromises); performance.mark('B'); + // Filter out invalid/broken characters + characters = Object.values(characters).filter(x => x?.name).reduce((acc, val, index) => { + acc[index] = val; + return acc; + }, {}); + response.send(JSON.stringify(characters)); }); });