diff --git a/server.js b/server.js index 12fc3fc3f..c4fbf3fbe 100644 --- a/server.js +++ b/server.js @@ -1360,6 +1360,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)); }); });